When making a request to an IPv6 address with a zone identifier, for
exmaple [fe80::1%en0], RFC 6874 says HTTP clients must remove the zone
identifier "%en0" before writing the request for security reason.
This change removes any IPv6 zone identifer attached to URI in the Host
header field in requests.
See golang/go#9544.
Change-Id: Ie5d18a0bc5f2768a95c59ec2b159ac0abdf685e8
Reviewed-on: https://go-review.googlesource.com/13296
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
If client sent no subprotocol (e.g. no Sec-WebSocket-Protocol),
websocket server responded with the following header
HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: E7SRWRnZL9RuGFLuZ0j4508nqdg=
Sec-WebSocket-Protocol:
So, client may close the connection because it contains
wrong empty Sec-WebSocket-Protocol header.
If client didn't offer any subprotocol, don't set
config.Protocol, so that not emit empty Sec-WebSocket-Protocol.
Fixesgolang/go#5457.
R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/9379044
Add websocket.Server to configure WebSocket server handler.
- Config.Header is additional headers to send, so you can use it
to send cookies or so.
To read cookies, you can use Conn.Request().Header.
- factor out Handshake.
You can set func to check origin, subprotocol etc.
Handler checks origin by default.
Fixesgolang/go#4198.
Fixesgolang/go#5178.
R=golang-dev, mikioh.mikioh, crobin
CC=golang-dev
https://golang.org/cl/8731044
Manual edits to README.
Moved from main Go repository, deleted Makefiles, ran gofix -r go1rename.
Tested with: go test code.google.com/p/go.net/...
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5574065