自己按照 Websocket 的 文檔寫的, 浏覽器每次連接上, 一收到消息就斷開了
報錯:WebSocket connection to 'ws://192.168.1.248:2051/' failed: A server must not mask any frames that it sends to the client.
但是 內容根本就沒有mask
然後連網上別的websocket服務器,連上發消息正常, 然後直接對消息抓包 過來原文發送,還是包這個錯誤;
wireshark 都能識別,但是 浏覽器就是一收到就報錯斷開,,,快崩潰了了~~~~
下面是發送的數據:
char tt[250]={0x81,0x53,0x7b,0x22,0x6a,0x73,0x6f,0x6e,0x72,0x70
,0x63,0x22,0x3a,0x22,0x32,0x2e,0x30,0x22,0x2c,0x22,0x65,0x72,0x72,0x6f,0x72,0x22
,0x3a,0x7b,0x22,0x63,0x6f,0x64,0x65,0x22,0x3a,0x2d,0x31,0x30,0x30,0x30,0x30,0x32
,0x2c,0x22,0x6d,0x65,0x73,0x73,0x61,0x67,0x65,0x22,0x3a,0x22,0x54,0x65,0x73,0x74
,0x5f,0x56,0x61,0x6c,0x75,0x65,0x20,0x69,0x73,0x20,0x6e,0x6f,0x74,0x20,0x76,0x61
,0x6c,0x69,0x64,0x20,0x6a,0x73,0x6f,0x6e,0x22,0x7d,0x7d,0};
重新寫了server的發送數據幀, 問題已解決!