5. Using Extended CONNECT to Bootstrap the WebSocket Protocol
The :protocol pseudo-header field included in the CONNECT request indicates that the stream is to be used for the WebSocket Protocol. The value of this field MUST be "websocket".
The :scheme pseudo-header field MUST be set to "https" for wss URIs and "http" for ws URIs.
The :path pseudo-header field MUST be set to the path and query parts of the target URI.
The :authority pseudo-header field MUST be set to the authority part of the target URI.
The request MUST NOT contain "Connection", "Upgrade", "Sec-WebSocket-Key", or "Sec-WebSocket-Version" header fields.
A server that supports this document AND receives a CONNECT request with a :protocol pseudo-header field equal to "websocket" MUST process the request as a WebSocket handshake.
If the server agrees to the WebSocket connection, it MUST respond with a 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)