Files
swift-http-types/Sources/HTTPTypesFoundation
Guoye ZhangandCory Benfield 9c9d5ea7e3 Convert WebSocket URLRequest to RFC8441 HTTPRequest (#92)
WebSocket uses the extended-CONNECT form in HTTP/2 and HTTP/3. When
creating an HTTPRequest from a URLRequest, we should translate it into
the new form.

`:method`: `GET` -> `CONNECT`
`:scheme`: `wss`/`ws` -> `https`/`http`
`:protocol`: `websocket`

HTTPTypes defaults to modern HTTP versions, and the expectation is that
the HTTP/1 serializer has to translate the extended-CONNECT request back
to the old request form.

---------

Co-authored-by: Cory Benfield <lukasa@apple.com>
2025-10-05 11:13:17 -07:00
..