Documentation ¶
Overview ¶
Package websocket implements a basic websocket server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
Handler handles a single websocket message. If the returned message is non-nil, it will be sent to the client. If an error is returned, the connection will be closed.
type Message ¶
Message is an application-level message from the client, which may be constructed from one or more individual protocol frames.
type StatusCode ¶
type StatusCode uint16
StatusCode is a websocket status code.
const ( StatusNormalClosure StatusCode = 1000 StatusGoingAway StatusCode = 1001 StatusProtocolError StatusCode = 1002 StatusUnsupported StatusCode = 1003 StatusNoStatusRcvd StatusCode = 1005 StatusAbnormalClose StatusCode = 1006 StatusUnsupportedPayload StatusCode = 1007 StatusPolicyViolation StatusCode = 1008 StatusTooLarge StatusCode = 1009 StatusTlSHandshake StatusCode = 1015 StatusServerError StatusCode = 1011 )
See the RFC for the set of defined status codes: https://datatracker.ietf.org/doc/html/rfc6455#section-7.4.1
type WebSocket ¶
type WebSocket struct {
// contains filtered or unexported fields
}
WebSocket is a websocket connection.
Click to show internal directories.
Click to hide internal directories.