SuperWebSocket icon indicating copy to clipboard operation
SuperWebSocket copied to clipboard

WebSocketServer.cs:行号 640 System.IndexOutOfRangeException: 索引超出了数组界限

Open tupunco opened this issue 11 years ago • 6 comments

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

Line640

tupunco avatar Jan 14 '15 07:01 tupunco

Which version are you using? How to reproduce it?

kerryjiang avatar Jan 15 '15 00:01 kerryjiang

我看日志内有很"方块", 推测是畸形HTTP数据头,

tupunco avatar Jan 20 '15 01:01 tupunco

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==

tupunco avatar Jan 20 '15 02:01 tupunco

Getting same error on SuperSocket 1.6.5.

skaa avatar Jul 20 '16 08:07 skaa

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

sushilksharma avatar Oct 17 '16 05:10 sushilksharma

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.

sushilksharma avatar Oct 17 '16 05:10 sushilksharma