Socket.io can't connect to WebSockets (only)
See original GitHub issueYou 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
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Troubleshooting connection issues | Socket.IO
You are trying to reach a plain WebSocket server; The server is not reachable; The client is not compatible with the version of...
Read more >WebSocket not connecting to socket.io - Stack Overflow
You need a socket.io client to pass some authentication phases I believe. Try this, and it should work(the client javascript is served by ......
Read more >Can not connect to socket.io with websocket - Microsoft Q&A
Hi,. This is my Azure NodeJS AppService's socket.io setup. Client side: const socket = io('https://testappsocket.azurewebsites.net', ...
Read more >Socket.IO vs. WebSocket: A comparison - Ably Realtime
IO officially only provided a Node.js server implementation, ... IO client will not be able to connect to a plain WebSocket server either....
Read more >Differences between WebSockets and Socket.IO - ITNEXT
You have 2 free member-only stories left this month. ... If (for some reason) a WebSocket connection drops, it will not automatically ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @hongweipeng, Im using new WebSocket() direct instead of using Socket.IO client.
@patrickbussmann Well,Im also going to use the same way as you, thx.