5. 使用 Extended CONNECT 引导 WebSocket Protocol (Using Extended CONNECT to Bootstrap the WebSocket Protocol)
CONNECT request 中包含的 :protocol pseudo-header field 指示该 stream 将用于 WebSocket Protocol. 此 field 的值 MUST 为 "websocket".
对于 wss URIs, :scheme pseudo-header field MUST 设置为 "https"; 对于 ws URIs, MUST 设置为 "http".
:path pseudo-header field MUST 设置为 target URI 的 path 和 query 部分.
:authority pseudo-header field MUST 设置为 target URI 的 authority 部分.
该 request MUST NOT 包含 "Connection", "Upgrade", "Sec-WebSocket-Key" 或 "Sec-WebSocket-Version" header fields.
支持本文档且收到 :protocol pseudo-header field 等于 "websocket" 的 CONNECT request 的 server, MUST 将该 request 作为 WebSocket handshake 处理.
如果 server 同意 WebSocket connection, 它 MUST 以 200 (OK) status code 响应.
5.1. 示例 (Example)
[[HEADERS frame]] :method = CONNECT :protocol = websocket :scheme = https :path = /chat :authority = server.example.com sec-websocket-protocol = chat, superchat sec-websocket-version = 13 origin = http://www.example.com
[[DATA frame]] (WebSocket data)