You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hellflame e8629af678
improve echo example (#671)
4 months ago
.circleci build: use build matrix; drop Go <= 1.10 (#629) 1 year ago
.github Create release-drafter.yml (#538) 2 years ago
examples improve echo example (#671) 4 months ago
.gitignore add newline and remove extra space 3 years ago
AUTHORS Update LICENSE file to reflect Google employee contributions. 3 years ago
LICENSE Relicense to the Gorilla WebSocket Authors. 7 years ago
README.md Changed the link of API references to pkg.go.dev (#577) 1 year ago
client.go Fix how the client checks for presence of Upgrade: websocket, Connection: upgrade (#604) 1 year ago
client_clone.go Update cloneTLSConfig to use Go 1.8 Config.Clone method 4 years ago
client_clone_legacy.go Update cloneTLSConfig to use Go 1.8 Config.Clone method 4 years ago
client_server_test.go Fix how the client checks for presence of Upgrade: websocket, Connection: upgrade (#604) 1 year ago
client_test.go Replace parseURL() with net/url.Parse() (#290) 3 years ago
compression.go fix flate write pool size to work with best compression 4 years ago
compression_test.go Add write buffer pooling 3 years ago
conn.go Duration order consistency when multiplying number by time unit (#570) 1 year ago
conn_broadcast_test.go miscellaneous cleanup 3 years ago
conn_test.go Read Limit Fix (#537) 2 years ago
conn_write.go Use net.Buffers to write multiple slices to connection 3 years ago
conn_write_legacy.go Use net.Buffers to write multiple slices to connection 3 years ago
doc.go docs: Fix typo. (#568) 1 year ago
example_test.go Fix a couple of small typo's (#567) 1 year ago
go.mod Read Limit Fix (#537) 2 years ago
go.sum build: clean up go.sum (#584) 1 year ago
join.go Add JoinMessages 2 years ago
join_test.go Add JoinMessages 2 years ago
json.go Misc cleanup 4 years ago
json_test.go Add write buffer pooling 3 years ago
mask.go Update with gofmt on tip 3 years ago
mask_safe.go Add safe maskBytes 4 years ago
mask_test.go miscellaneous cleanup 3 years ago
prepared.go Use empty struct to protect writing (#566) 1 year ago
prepared_test.go Add write buffer pooling 3 years ago
proxy.go Fix typo 2 years ago
server.go docs: clarify that sub protocols are not set via responseHeader arg. 1 year ago
server_test.go miscellaneous cleanup 3 years ago
trace.go Add context in the Dialer 3 years ago
trace_17.go Add context in the Dialer 3 years ago
util.go Improve header parsing code 3 years ago
util_test.go Improve header parsing code 3 years ago
x_net_proxy.go Add SOCKS5 support 3 years ago

README.md

Gorilla WebSocket

GoDoc CircleCI

Gorilla WebSocket is a Go implementation of the WebSocket protocol.

Documentation

Status

The Gorilla WebSocket package provides a complete and tested implementation of the WebSocket protocol. The package API is stable.

Installation

go get github.com/gorilla/websocket

Protocol Compliance

The Gorilla WebSocket package passes the server tests in the Autobahn Test Suite using the application in the examples/autobahn subdirectory.

Gorilla WebSocket compared with other packages

github.com/gorilla golang.org/x/net
RFC 6455 Features
Passes Autobahn Test SuiteYesNo
Receive fragmented messageYesNo, see note 1
Send close messageYesNo
Send pings and receive pongsYesNo
Get the type of a received data messageYesYes, see note 2
Other Features
Compression ExtensionsExperimentalNo
Read message using io.ReaderYesNo, see note 3
Write message using io.WriteCloserYesNo, see note 3

Notes:

  1. Large messages are fragmented in Chrome's new WebSocket implementation.
  2. The application can get the type of a received data message by implementing a Codec marshal function.
  3. The go.net io.Reader and io.Writer operate across WebSocket frame boundaries. Read returns when the input buffer is full or a frame boundary is encountered. Each call to Write sends a single frame message. The Gorilla io.Reader and io.WriteCloser operate on a single WebSocket message.