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