Apr 1, 2015

Connect to NodeJS Socket.IO server from Unity3d using WebSocketSharp

It wont work out of the box. So no connections with simple

using (var ws = new WebSocket ("ws://127.0.0.1")) {
ws.Connect();
};

Socket.IO clients hides much of inner details. So when you using plain WebSocket client you need to provide some additional params like this:

using (var ws = new WebSocket ("ws://127.0.0.1/socket.io/?EIO=3&transport=websocket&b64=1")) {
ws.Connect();
};

No comments:

Post a Comment