Skip to content

Handshake requires 101 response; conflicts with WebSockets over H2/H3 (Extended CONNECT) #70

@jan-ivar

Description

@jan-ivar

What is the issue with the WebSockets Standard?

The opening-handshake algorithm step 11.1 says: “If response is a network error or its status is not 101, fail the WebSocket connection.”

This is correct for HTTP/1.1 Upgrade, but rejects successful WebSocket handshakes over HTTP/2 and HTTP/3, which use Extended CONNECT and signal success with a 2xx response.

At minimum that step needs to accept 2xx, I think.

It might also be worth a note that the H/1.1+101 path this spec models (Upgrade: websocket, Connection: Upgrade, Sec-WebSocket-Key etc) doesn't work with HTTP/2 and HTTP/3 which instead require bootstrapping WS over H2/H3 using Extended CONNECT per RFC 8441 / 9220 respectively (helps readers discover the RFCs).

Updating the steps themselves seems hard given the type of connection is not known ahead of fetch (unless perhaps the request can be passed to obtain a WebSocket connection for modding?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions