Loading…
|
Translation changed |
|
|
String added in the repository |
|
Loading…
|
Translation changed |
|
|
String added in the repository |
|
For servers accepting incoming connections, the对于接受入站连接的服务器,[link beast.ref.boost__beast__websocket__stream `websocket::stream`]can read the incoming upgrade request and automatically reply. If the handshake meets the requirements, the stream sends back the upgrade response with a [@https://tools.ietf.org/html/rfc6455#section-4.2.2 ['101 Switching Protocols]] status code. If the handshake does not meet the requirements, or falls outside the range of allowed parameters specified by stream options set previously by the caller, the stream sends back an HTTP response with a status code indicating an error. Depending on the可以读取入站升级请求并自动回复。如果握手满足要求,流会返回一个状态码为 `101 Switching Protocols` 的升级响应。如果握手不符合要求,或超出调用方先前设置的流选项所允许的参数范围,流会返回一个带有错误状态码的 HTTP 响应。根据 keep-alivesetting, the connection may remain open for a subsequent handshake attempt. A typical HTTP Upgrade response created and sent by the implementation upon receiving an upgrade request handshake will look like this:设置,连接可能会保持打开状态,以便后续再次尝试握手。当接收到升级请求握手时,实现创建并发送的典型 HTTP 升级响应如下所示: