Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket.io can't connect to WebSockets (only) #1208

Closed
1 of 2 tasks
patrickbussmann opened this issue May 22, 2018 · 7 comments
Closed
1 of 2 tasks

Socket.io can't connect to WebSockets (only) #1208

patrickbussmann opened this issue May 22, 2018 · 7 comments

Comments

@patrickbussmann
Copy link

You want to:

  • report a bug
  • request a feature

Current behaviour

I connect to a WebSocket using Socket.io and no connection will be established.
The WebSocket server (PHP Ratchet) detects a connection but this will be closed soon and Socket.IO never says that the client is connected to the server.

Steps to reproduce (if the current behaviour is a bug)

var conn = io('wss://demos.kaazing.com/echo', { upgrade: false, transports: ['websocket'] });

Error: Error during WebSocket handshake: Unexpected response code: 403

This is working:

var conn = new WebSocket('wss://demos.kaazing.com/echo');

-> Tested in the console of https://socket.io/get-started/chat/ <-

Expected behaviour

That socket.io can handle the WebSocket 👍

Setup

  • OS: Windows 10
  • browser: Google Chrome 66.0.3359.181 (Official Build) (64-bit)
  • socket.io version: 1.3.5 and 2.1
@darrachequesne
Copy link
Member

@patrickbussmann actually, Socket.IO is not a WebSocket implementation, it has its own protocol which may use a WebSocket connection to transmit data.

@patrickbussmann
Copy link
Author

patrickbussmann commented May 24, 2018 via email

@hongweipeng
Copy link

@patrickbussmann Brother, I also encountered this problem, I want to find a websocket tool,but this seems to be used only Socket.io as server side.Have you found a solution?

@patrickbussmann
Copy link
Author

Hi @hongweipeng,
Im using new WebSocket() direct instead of using Socket.IO client.

@hongweipeng
Copy link

@patrickbussmann Well,Im also going to use the same way as you, thx.

@chengwb53
Copy link

chengwb53 commented Aug 5, 2020

emmm socket.io-client connected java websocket, but don't know how to exchange message

@darrachequesne
Copy link
Member

For future readers, please see https://socket.io/docs/v3/#What-Socket-IO-is-not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants