Documentation
¶
Overview ¶
Package ws provides a WebSocket transport wrapper for connecting to Rust companion servers.
Index ¶
Constants ¶
const DefaultReadLimit = 32 * 1024 * 1024
DefaultReadLimit is the maximum size in bytes allowed for received WebSocket messages (32 MB).
Variables ¶
var ErrUnexpectedMessageType = errors.New("unexpected non-binary websocket message type")
ErrUnexpectedMessageType is returned when a received WebSocket frame is not binary.
Functions ¶
Types ¶
type Conn ¶
type Conn interface {
// Send writes a binary message to the WebSocket.
Send(ctx context.Context, data []byte) error
// Recv reads a binary message from the WebSocket.
Recv(ctx context.Context) ([]byte, error)
// Close gracefully closes the WebSocket connection.
Close() error
}
Conn is the transport interface for sending and receiving raw bytes over WebSocket.