doghappy / socket.io-client-csharp

socket.io-client implemention for .NET
MIT License
715 stars 124 forks source link

Can't connect with ExtraHeaders User Agent. #373

Open sqpp opened 2 months ago

sqpp commented 2 months ago

Issue is present with given User-Agent, the agent does not matter, all seems to fail.

var options = new SocketIOOptions()
   {
      AutoUpgrade = true,
      Path = "/socket.io/",
      Reconnection = false,
      Transport = SocketIOClient.Transport.TransportProtocol.WebSocket,
      ExtraHeaders = new Dictionary<string, string>()
       {
         ["User-Agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.50",
        }
    };

When this extra option is removed, the request goes through fine.

Running 3.0.6.

Any idea?

doghappy commented 2 months ago

Here is the Change log:

[3.0.7] - 2022-11-29

Added

Changed


that means you need upgrade to 3.0.7 at least