Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultWebsocketPingInterval = 25 * time.Second DefaultWebsocketWriteTimeout = 1 * time.Second DefaultWebsocketMessageSizeLimit = 65536 // 64KB )
Defaults.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config = configtypes.UniWebSocket
type ConnectRequest ¶
type ConnectRequest struct { Token string `json:"token,omitempty"` Data json.RawMessage `json:"data,omitempty"` Subs map[string]*SubscribeRequest `json:"subs,omitempty"` Name string `json:"name,omitempty"` Version string `json:"version,omitempty"` }
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler handles WebSocket client connections. Usually WebSocket protocol is a bidirectional connection between a client and a server for low-latency communication. Here we utilize only one direction - giving users an additional option for unidirectional transport.
func NewHandler ¶
func NewHandler( n *centrifuge.Node, c Config, CheckOrigin func(r *http.Request) bool, pingPong centrifuge.PingPongConfig, ) *Handler
NewHandler creates new Handler.
type SubscribeRequest ¶
Click to show internal directories.
Click to hide internal directories.