Skip to content

Commit 78ab81e

Browse files
authored
docs: clarify that sub protocols are not set via responseHeader arg.
1 parent 873e67e commit 78ab81e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ func (u *Upgrader) selectSubprotocol(r *http.Request, responseHeader http.Header
115115
// Upgrade upgrades the HTTP server connection to the WebSocket protocol.
116116
//
117117
// The responseHeader is included in the response to the client's upgrade
118-
// request. Use the responseHeader to specify cookies (Set-Cookie) and the
119-
// application negotiated subprotocol (Sec-WebSocket-Protocol).
118+
// request. Use the responseHeader to specify cookies (Set-Cookie). To specify
119+
// subprotocols supported by the server, set Upgrader.Subprotocols directly.
120120
//
121121
// If the upgrade fails, then Upgrade replies to the client with an HTTP error
122122
// response.

0 commit comments

Comments
 (0)