sta / sta/websocket-sharp

WebSocketException with Firefox

Open
#434 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
6.1k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

Hello,
I using Websocket-sharp for server. When connect with firefox, sometimes (randomly), show this error in server console, but work fine.

28-02-2018 22:46:27|Fatal|ExecutionContext.RunInternal|WebSocketSharp.WebSocketException: An exception has occurred while reading an HTTP request/response. ---> System.IO.EndOfStreamException: The header cannot be read from the data source.
                             en WebSocketSharp.HttpBase.<>c__DisplayClass1.<readHeaders>b__0(Int32 i)
                             en WebSocketSharp.Ext.EqualsWith(Int32 value, Char c, Action`1 action)
                             en WebSocketSharp.HttpBase.readHeaders(Stream stream, Int32 maxLength)
                             en WebSocketSharp.HttpBase.Read[T](Stream stream, Func`2 parser, Int32 millisecondsTimeout)
                             --- Fin del seguimiento de la pila de la excepción interna ---
                             en WebSocketSharp.HttpBase.Read[T](Stream stream, Func`2 parser, Int32 millisecondsTimeout)
                             en WebSocketSharp.HttpRequest.Read(Stream stream, Int32 millisecondsTimeout)
                             en WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext..ctor(TcpClient tcpClient, String protocol, Boolean secure, ServerSslConfiguration sslConfig, Logger logger)
                             en WebSocketSharp.Ext.GetWebSocketContext(TcpClient tcpClient, String protocol, Boolean secure, ServerSslConfiguration sslConfig, Logger logger)
                             en WebSocketSharp.Server.WebSocketServer.<>c__DisplayClass1.<receiveRequest>b__0(Object state)

If I connect with Chrome, this error dont show.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with WebSocketSharp.HttpBase.readHeaders and HttpRequest.Read, then trace how TcpListenerWebSocketContext handles the Firefox connection shown in the stack trace. Compare the failing Firefox request with the working Chrome path and determine whether the end-of-stream is handled correctly. Done means the intermittent Firefox connection no longer produces an inappropriate fatal server error.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.