sta / sta/websocket-sharp

WebSocketSharp.WebSocketException: Not a WebSocket handshake response

Open
#486 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

when i use the client, i got an exception, like the title:

using (var ws = new WebSocket("ws://localhost:80/message/websocket?app_key=1000405"))
            {
                ws.OnMessage += (sender, e) =>
                    Console.WriteLine("Laputa says: " + e.Data);
                ws.OnClose += (send, e) =>
                {
                    Console.WriteLine("-----On close-----");
                    Console.WriteLine(e.Reason);    
                };
                ws.OnOpen += (sender, e) =>
                {
                    Console.WriteLine("----- OnOpen-----");
                    Console.WriteLine(e);
                };
                ws.OnError += (sender, e) =>
                {
                    Console.WriteLine("----- OnError-----");
                    Console.WriteLine(e);
                };
                ws.EmitOnPing = true;
                ws.Connect();
                ws.Send("BALUS");
                Console.ReadKey(true);
            }
        }

this is response:

2018/8/28 9:00:09|Fatal|WebSocket.connect:0|WebSocketSharp.WebSocketException: Not a WebSocket handshake response.
                          at WebSocketSharp.WebSocket.doHandshake () [0x0002a] in <3bfb09d1ec3f41079da19be18a3ba9a3>:0 
                          at WebSocketSharp.WebSocket.connect () [0x00083] in <3bfb09d1ec3f41079da19be18a3ba9a3>:0 
-----On close-----
An exception has occurred while connecting.

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 the WebSocket.connect and WebSocket.doHandshake entry points named in the stack trace, using the ws://localhost:80/message/websocket?app_key=1000405 example as the reproduction. Inspect the server response to determine why it is not accepted as a WebSocket handshake; done requires identifying a reproducible cause and documenting or testing the resulting fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
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.