# README
Fasthttp WebSocket
WebSocket is a Go implementation of the WebSocket for fasthttp.
This project is a fork of the latest version of gorilla/websocket that continues its development independently.
Documentation
Status
The WebSocket package provides a complete and tested implementation of the WebSocket protocol. The package API is stable.
Installation
go get github.com/fasthttp/websocket
But beware that this will fetch the latest commit of the master branch which is never purposely broken, but usually not considered stable anyway.
Protocol Compliance
The WebSocket package passes the server tests in the Autobahn Test Suite using the application in the _examples/autobahn subdirectory.
# Functions
FastHTTPIsWebSocketUpgrade returns true if the client requested upgrade to the WebSocket protocol.
FormatCloseMessage formats closeCode and text as a WebSocket close message.
No description provided by the author
IsCloseError returns boolean indicating whether the error is a *CloseError with one of the specified codes.
IsUnexpectedCloseError returns boolean indicating whether the error is a *CloseError with a code not in the list of expected codes.
IsWebSocketUpgrade returns true if the client requested upgrade to the WebSocket protocol.
JoinMessages concatenates received messages to create a single io.Reader.
NewClient creates a new client connection using the given net connection.
NewPreparedMessage returns an initialized PreparedMessage.
ReadJSON reads the next JSON-encoded message from the connection and stores it in the value pointed to by v.
Subprotocols returns the subprotocols requested by the client in the Sec-Websocket-Protocol header.
Upgrade upgrades the HTTP server connection to the WebSocket protocol.
WriteJSON writes the JSON encoding of v as a message.
# Constants
BinaryMessage denotes a binary data message.
Close codes defined in RFC 6455, section 11.7.
Close codes defined in RFC 6455, section 11.7.
Close codes defined in RFC 6455, section 11.7.
Close codes defined in RFC 6455, section 11.7.
Close codes defined in RFC 6455, section 11.7.
CloseMessage denotes a close control message.
Close codes defined in RFC 6455, section 11.7.
Close codes defined in RFC 6455, section 11.7.
Close codes defined in RFC 6455, section 11.7.
Close codes defined in RFC 6455, section 11.7.
Close codes defined in RFC 6455, section 11.7.
Close codes defined in RFC 6455, section 11.7.
Close codes defined in RFC 6455, section 11.7.
Close codes defined in RFC 6455, section 11.7.
Close codes defined in RFC 6455, section 11.7.
PingMessage denotes a ping control message.
PongMessage denotes a pong control message.
TextMessage denotes a text data message.
# Variables
DefaultDialer is a dialer with all fields set to the default values.
ErrBadHandshake is returned when the server response to opening handshake is invalid.
ErrCloseSent is returned when the application writes a message to the connection after sending a close message.
No description provided by the author
No description provided by the author
ErrReadLimit is returned when reading a message that is larger than the read limit set for the connection.
No description provided by the author
# Structs
CloseError represents a close message.
The Conn type represents a WebSocket connection.
A Dialer contains options for connecting to WebSocket server.
FastHTTPUpgrader specifies parameters for upgrading an HTTP connection to a WebSocket connection.
HandshakeError describes an error with the handshake from the peer.
PreparedMessage caches on the wire representations of a message payload.
Upgrader specifies parameters for upgrading an HTTP connection to a WebSocket connection.
# Interfaces
BufferPool represents a pool of buffers.
# Type aliases
FastHTTPHandler receives a websocket connection after the handshake has been completed.