我正在尝试使用一段非常典型的代码连接到 lichess Web 套接字服务器:
let request = NSMutableURLRequest(url: URL(string: "wss://socket.lichess.org/")!)
self.webSocket = SRWebSocket(urlRequest: request as URLRequest!)
self.webSocket!.delegate = self
self.webSocket!.open()
但由于未知原因,我收到一个Invalid Sec-WebSocket-Accept response
:
2017-02-28 16:01:06.724415 Lichess[58458:3046032] Optional(<CFHTTPMessageRef 0x100f08140(0x100f08150)> { parsed response, url = (null), status = 200 })
2017-02-28 16:01:06.724563 Lichess[58458:3046032] Did fail with error: Invalid Sec-WebSocket-Accept response
我试图弄清楚过去几个小时出了什么问题,但仍然没有解决方案。谁熟悉这一点Sec-WebSocket-Accept
,哪里可能隐藏错误?