WebSocketServer.cs:行号 640 System.IndexOutOfRangeException: 索引超出了数组界限
System.IndexOutOfRangeException: 索引超出了数组界限。
在 SuperWebSocket.WebSocketServer`1.ParseHandshake(IWebSocketSession session, TextReader reader) 位置 \SuperWebSocket-master\SuperWebSocket\WebSocketServer.cs:行号 640
在 SuperWebSocket.Protocol.WebSocketHeaderReceiveFilter.Filter(Byte[] readBuffer, Int32 offset, Int32 length, Boolean isReusableBuffer, Int32& rest) 位置 \SuperWebSocket-master\SuperWebSocket\Protocol\WebSocketHeaderReceiveFilter.cs:行号 63
Which version are you using? How to reproduce it?
我看日志内有很"方块", 推测是畸形HTTP数据头,
2015-01-20 09:53:01,244 [74620] ERROR [--------] - Failed to parse handshake!
���؆
GET / HTTP/1.1
Host: TTT.TTT.TTT.com:86
Cookie: TTT=TTT
Connection: Upgrade
Sec-WebSocket-Version: 13
Origin: http://TTT.TTT.TTT.com:86/
Upgrade: websocket
Sec-WebSocket-Key: D40uSLiQTxbN4LlZ/WhVnA==
Getting same error on SuperSocket 1.6.5.
I am getting the similar issue, and when i printed the logs(I added addition logs in SuperWebSocket), there was an addition "\r" after "/", which was causing the issue. Strangely this issue is observed when my application is accessed over internet.Application is hosted on Azure. But when the same application is hosted in local network and client is also in local network, there is no issue.
47 45 54 20 2F 0D 20 48 54 54 50 2F 31 2E 31 0D 0A 50 72 61 67 6D 61 3A 20 6E 6F 2D 63 61 63 68 65 0D
G E T / CR H T T P / 1 . 1 CR LF P r a g m a : n o - c a c h e CR LF
In my case client is developed using libwebsocket on linux platform. Same client works fine with server developed using Microsoft Websocket on windows 2012 R2.