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.
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/ <-
That socket.io can handle the WebSocket 👍
@patrickbussmann actually, Socket.IO is not a WebSocket implementation, it has its own protocol which may use a WebSocket connection to transmit data.
But i think When i specify it in the options it should use only websockets.
Do you know how to use Ratchet PHP with Socket.IO?
It Supports http Server etc also.
But tested and not works.
@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?
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.
emmm socket.io-client connected java websocket, but don't know how to exchange message