Explorar o código

Improve server subprotocol documentation

Partial fix for 404.
stevenscott89 %!s(int64=7) %!d(string=hai) anos
pai
achega
3ff3320c2a
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      server.go

+ 4 - 2
server.go

@@ -34,9 +34,11 @@ type Upgrader struct {
 	ReadBufferSize, WriteBufferSize int
 
 	// Subprotocols specifies the server's supported protocols in order of
-	// preference. If this field is set, then the Upgrade method negotiates a
+	// preference. If this field is not nil, then the Upgrade method negotiates a
 	// subprotocol by selecting the first match in this list with a protocol
-	// requested by the client.
+	// requested by the client. If there's no match, then no protocol is
+	// negotiated (the Sec-Websocket-Protocol header is not included in the
+	// handshake response).
 	Subprotocols []string
 
 	// Error specifies the function for generating HTTP error responses. If Error