nathan-alden-sr / proxy

An HTTP proxy server written in C# and targeting .NET Core 3.
MIT License
33 stars 11 forks source link

Web Socket connections are not stable #2

Open w01fgang opened 5 years ago

w01fgang commented 5 years ago

Sometimes I have next error:

2019-06-07 15:36:10 [Error] [DS 9] 127.0.0.1 Unexpected error
System.NotSupportedException: Stream does not support reading.
   at System.IO.BufferedStream.EnsureCanRead()
   at System.IO.BufferedStream.Read(Byte[] array, Int32 offset, Int32 count)
   at NathanAlden.Proxy.Tcp.TcpClientWrapper.Read() in C:\Users\xxx\Documents\source\proxy\src\Proxy\Tcp\TcpClientWrapper.cs:line 38
   at NathanAlden.Proxy.HttpClient.HttpClient.Read() in C:\Users\xxx\Documents\source\proxy\src\Proxy\HttpClient\HttpClient.cs:line 150
   at NathanAlden.Proxy.Services.DownstreamClientService.DownstreamClient.<>c__DisplayClass19_0.<Run>b__9() in C:\Users\xxx\Documents\source\proxy\src\Proxy\Services\DownstreamClientService\DownstreamClient.cs:line 291

Web sockets connection fails but not always, only first few attempts.

nathan-alden-sr commented 4 years ago

Sorry, I haven't been very active lately on GitHub. If I can find some time I'll take a look at this. Do you know of a good site I can test websockets with? I hadn't thought of those when I first wrote this.

w01fgang commented 4 years ago

There is a websocket connection to get realtime messages from Twitter on Socket.io website https://socket.io/ Thank you!