Skip to content

Improve upgrader documentation regarding protocols #404

@ghost

Description

Points to cover

  • An application can handle subprotocol negotiation on its own by setting the Sec-Websocket-Protocol response header. The Subprotocols(r *http.Request) []string function is helpful here.
  • Set u.Subprotocols for builtin subprotocol negotiation. Builtin negotiation overrides a subprotocol specified in the response header (it would have been better to return an error, but it's too late to change that).
  • Builtin negotiation uses first match in u.Subprotocols. If there's no match, then no protocol is negotiated.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions