Loading…
|
Translation changed |
|
|
String added in the repository |
|
Loading…
|
Translation changed |
|
|
String added in the repository |
|
The code that follows demonstrates how a server reads an HTTP request, identifies it as a WebSocket Upgrade, and then checks for a preferred matching subprotocol before performing the WebSocket handshake:以下代码演示服务器如何读取 HTTP 请求,识别其为 WebSocket 升级请求,并在执行 WebSocket 握手之前检查是否存在匹配的优先子协议: