Documentation
¶
Overview ¶
Package server provides the WebSocket server implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WsServer ¶
type WsServer struct {
// contains filtered or unexported fields
}
WsServer is a WebSocket server that handles WebSocket connections. It contains a processMessage field which is a slice of functions to process incoming WebSocket messages.
func New ¶
New creates a new WsServer instance with the provided message processing functions. The processMessage functions will be called to handle each incoming WebSocket message.
func (*WsServer) HandleWebSocket ¶
func (s *WsServer) HandleWebSocket(w http.ResponseWriter, r *http.Request)
HandleWebSocket handles websocket requests by upgrading the HTTP connection to a WebSocket connection.
Click to show internal directories.
Click to hide internal directories.