You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.