Clone this repo:
  1. 66b9c49 Move context to first parameter in DialContext by Mathias Fredriksson · 4 weeks ago master v1.4.0
  2. a9dd6e8 miscellaneous cleanup by Steven Scott · 4 weeks ago
  3. ceae452 Add context in the Dialer by SALLEYRON Julien · 4 weeks ago
  4. b378cae Add write buffer pooling by Steven Scott · 5 weeks ago
  5. 5fb9417 drop Go versions prior to 1.7 in CI by Adam Shannon · 5 weeks ago

Gorilla WebSocket

Gorilla WebSocket is a Go implementation of the WebSocket protocol.

Build Status GoDoc



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


go get

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


  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 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.