Improve Upgrade documentation.

This commit is contained in:
Gary Burd 2013-12-20 14:54:49 -08:00
parent 536d8dd066
commit 9cdec41bda
1 changed files with 12 additions and 8 deletions

View File

@ -29,15 +29,19 @@ func (e HandshakeError) Error() string { return e.message }
// return // return
// } // }
// //
// If the endpoint supports WebSocket subprotocols, then the application is // If the endpoint supports subprotocols, then the application is responsible
// responsible for selecting a subprotocol that is acceptable to the client and // for negotiating the protocol used on the connection. Use the Subprotocols()
// echoing that value back to the client. Use the Subprotocols function to get // function to get the subprotocols requested by the client. Use the
// the list of protocols specified by the client. Use the // Sec-Websocket-Protocol response header to specify the subprotocol selected
// Sec-Websocket-Protocol response header to echo the selected protocol back to // by the application.
// the client.
// //
// Appilcations can set cookies by adding a Set-Cookie header to the response // The responseHeader is included in the response to the client's upgrade
// header. // request. Use the responseHeader to specify cookies (Set-Cookie) and the
// negotiated subprotocol (Sec-Websocket-Protocol).
//
// The connection buffers IO to the underlying network connection. The
// readBufSize and writeBufSize parameters specify the size of the buffers to
// use. Messages can be larger than the buffers.
// //
// If the request is not a valid WebSocket handshake, then Upgrade returns an // If the request is not a valid WebSocket handshake, then Upgrade returns an
// error of type HandshakeError. Applications should handle this error by // error of type HandshakeError. Applications should handle this error by