WebSockets - Exception HTTP/1.1 101

692 Views Asked by At

I am developing .Net socket client application with WebSocket4Net library (I tried version from 14.0 to 15.0-beta6). Everything works nice, but suddenly I started to get Exception with message "HTTP/1.1 101" - no other details. Application didn't change, there might be only some small changes on Socket serwer (Spring). However, I can connect to this socket from native WebSocket (System.Net.WebSocket), as well as different tools, e.g. dark WebSockets from Chrome. What might cause this problem?

This is the simple code which not work: I don't get "Socket Opened", but " HTTP/1.1 101"

var socket = new WebSocket4Net.WebSocket("wss://addressToMySocket");
socket.Open();
socket.Opened += (sender, args) =>
{
    Console.WriteLine("Socket opened");
};

socket.Error += (sender, args) =>
{
    Console.WriteLine(args.Exception.Message);
};
1

There are 1 best solutions below

0
On BEST ANSWER

I found answer - the library splits response by spaces and needs to be three elements there. In my response, there is only two, but everything is ok. I think this is very stupid behaviour of this library