sta / websocket-sharp

A C# implementation of the WebSocket protocol client and server

Home Page:http://sta.github.io/websocket-sharp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not a WebSocket handshake response | Why not?

OssieFromDK opened this issue · comments

Hi, I have the following code to connect to a websocket, which I know exists.

internal Socket()
{
    using (var wss = new WebSocket("wss://<whatever>.com/socket.io/?EIO=4&transport=polling"))
    {
        wss.EnableRedirection = true;

        wss.OnMessage += (sender, e) =>
          Console.WriteLine("New message from controller: " + e.Data);
        wss.Connect();

        Console.ReadKey(true);
    }
}

The response is the following from the socket if I try to follow the uri I'm using the new WebSocket(blabla): 0{"sid":"HzvIKK7jW8lETZjzADTU","upgrades":["websocket"],"pingTimeout":20000,"pingInterval":25000}

Yet I keep getting Not a WebSocket handshake response.??

How is it not a websocket handshake response?, I can connect just fine using Javascript with io.connect("whatever.com").
Why won't it work in CS?

Thanks