}
/*
- Dial opens a new client connection to a Web Socket.
- A trivial example client is:
+Dial opens a new client connection to a Web Socket.
+
+A trivial example client:
package main
}
/*
- Generates handshake key as described in 4.1 Opening handshake
- step 16 to 22.
- cf. http://www.whatwg.org/specs/web-socket-protocol/
+Generates handshake key as described in 4.1 Opening handshake step 16 to 22.
+cf. http://www.whatwg.org/specs/web-socket-protocol/
*/
func generateKeyNumber() (key string, number uint32) {
// 16. Let /spaces_n/ be a random integer from 1 to 12 inclusive.
}
/*
- Generates handshake key_3 as described in 4.1 Opening handshake
- step 26.
- cf. http://www.whatwg.org/specs/web-socket-protocol/
+Generates handshake key_3 as described in 4.1 Opening handshake step 26.
+cf. http://www.whatwg.org/specs/web-socket-protocol/
*/
func generateKey3() (key []byte) {
// 26. Let /key3/ be a string consisting of eight random bytes (or
}
/*
- Gets expected from challenge as described in 4.1 Opening handshake
- Step 42 to 43.
- cf. http://www.whatwg.org/specs/web-socket-protocol/
+Gets expected from challenge as described in 4.1 Opening handshake
+step 42 to 43.
+cf. http://www.whatwg.org/specs/web-socket-protocol/
*/
func getExpectedForChallenge(number1, number2 uint32, key3 []byte) (expected []byte, err os.Error) {
// 41. Let /challenge/ be the concatenation of /number_1/, expressed
}
/*
- Web Socket protocol handshake based on
- http://www.whatwg.org/specs/web-socket-protocol/
- (draft of http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol)
+Web Socket protocol handshake based on
+http://www.whatwg.org/specs/web-socket-protocol/
+(draft of http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol)
*/
func handshake(resourceName, host, origin, location, protocol string, br *bufio.Reader, bw *bufio.Writer) (err os.Error) {
// 4.1. Opening handshake.
}
/*
- Handhake described in (soon obsolete)
- draft-hixie-thewebsocket-protocol-75.
+Handhake described in (soon obsolete)
+draft-hixie-thewebsocket-protocol-75.
*/
func draft75handshake(resourceName, host, origin, location, protocol string, br *bufio.Reader, bw *bufio.Writer) (err os.Error) {
bw.WriteString("GET " + resourceName + " HTTP/1.1\r\n")
)
/*
- Handler is an interface to a WebSocket.
- A trivial example server is:
+Handler is an interface to a WebSocket.
+
+A trivial example server:
package main
type Handler func(*Conn)
/*
- Gets key number from Sec-WebSocket-Key<n>: field as described
- in 5.2 Sending the server's opening handshake, 4.
+Gets key number from Sec-WebSocket-Key<n>: field as described
+in 5.2 Sending the server's opening handshake, 4.
*/
func getKeyNumber(s string) (r uint32) {
// 4. Let /key-number_n/ be the digits (characters in the range
/*
- Draft75Handler is an interface to a WebSocket based on
- (soon obsolete) draft-hixie-thewebsocketprotocol-75.
+Draft75Handler is an interface to a WebSocket based on the
+(soon obsolete) draft-hixie-thewebsocketprotocol-75.
*/
type Draft75Handler func(*Conn)