Versions in this module Expand all Collapse all v0 v0.2.1 Feb 9, 2024 Changes in this version + const DEFAULT_MAX_IP_WS_CONNS + const DEFAULT_MAX_WS_CONN_MSG_SIZE + const DEFAULT_WS_HANDSHAKE_TIMEOUT + const DEFAULT_WS_MESSAGE_TIMEOUT + const DEFAULT_WS_SERVER_HANDSHAKE_TIMEOUT + const DEFAULT_WS_SERVER_READ_BUFFER_SIZE + const DEFAULT_WS_SERVER_WRITE_BUFFER_SIZE + const DEFAULT_WS_WAIT_MESSAGE_TIMEOUT + const OPTION_DOES_NOT_EXIST_FMT + const SERVER_SIDE_WEBSOCKET_CLOSE_TIMEOUT + const WEBSOCKET_CLOSE_TASK_PER_GOROUTINE + const WEBSOCKET_SERVER_CLOSE_TIMEOUT + const WS_SIMUL_CONN_TOTAL_LIMIT_NAME + var ErrAlreadyReadingAllMessages = errors.New("already reading all messages") + var ErrClosedWebsocketServer = errors.New("closed websocket server") + var ErrClosingOrClosedWebsocketConn = errors.New("closed or closing websocket connection") + var ErrTooManyWsConnectionsOnIp = errors.New("too many websocket connections on same ip") + func NewWebsocketNamespace() *core.Namespace + type WebsocketConnectParams struct + Ctx *core.Context + HandshakeTimeout time.Duration + Insecure bool + MessageTimeout time.Duration + RequestHeader http.Header + URL core.URL + type WebsocketConnection struct + func WebsocketConnect(args WebsocketConnectParams) (*WebsocketConnection, error) + func (*WebsocketConnection) PropertyNames(ctx *core.Context) []string + func (*WebsocketConnection) SetProp(ctx *core.Context, name string, value core.Value) error + func (conn *WebsocketConnection) Close() error + func (conn *WebsocketConnection) Equal(ctx *core.Context, other core.Value, alreadyCompared map[uintptr]uintptr, ...) bool + func (conn *WebsocketConnection) GetGoMethod(name string) (*core.GoFunction, bool) + func (conn *WebsocketConnection) IsClosedOrClosing() bool + func (conn *WebsocketConnection) IsMutable() bool + func (conn *WebsocketConnection) PrettyPrint(w *bufio.Writer, config *core.PrettyPrintConfig, depth int, ...) + func (conn *WebsocketConnection) Prop(ctx *core.Context, name string) core.Value + func (conn *WebsocketConnection) ReadMessage(ctx *core.Context) (messageType WebsocketMessageType, p []byte, err error) + func (conn *WebsocketConnection) RemoteAddrWithPort() netaddr.RemoteAddrWithPort + func (conn *WebsocketConnection) SetPingHandler(ctx *core.Context, handler func(data string) error) + func (conn *WebsocketConnection) StartReadingAllMessagesIntoChan(ctx *core.Context, channel chan WebsocketMessageChanItem) error + func (conn *WebsocketConnection) ToSymbolicValue(ctx *core.Context, encountered map[uintptr]symbolic.Value) (symbolic.Value, error) + func (conn *WebsocketConnection) WriteMessage(ctx *core.Context, messageType WebsocketMessageType, data []byte) error + type WebsocketMessageChanItem struct + Error error + Payload []byte + Type WebsocketMessageType + type WebsocketMessageType int + const WebsocketBinaryMessage + const WebsocketCloseMessage + const WebsocketPingMessage + const WebsocketPongMessage + const WebsocketTextMessage + type WebsocketServer struct + func NewWebsocketServer(ctx *core.Context) (*WebsocketServer, error) + func (*WebsocketServer) PropertyNames(ctx *core.Context) []string + func (*WebsocketServer) SetProp(ctx *core.Context, name string, value core.Value) error + func (s *WebsocketServer) Close(ctx *core.Context) error + func (s *WebsocketServer) Equal(ctx *core.Context, other core.Value, alreadyCompared map[uintptr]uintptr, ...) bool + func (s *WebsocketServer) GetGoMethod(name string) (*core.GoFunction, bool) + func (s *WebsocketServer) IsMutable() bool + func (s *WebsocketServer) PrettyPrint(w *bufio.Writer, config *core.PrettyPrintConfig, depth int, ...) + func (s *WebsocketServer) Prop(ctx *core.Context, name string) core.Value + func (s *WebsocketServer) ToSymbolicValue(ctx *core.Context, encountered map[uintptr]symbolic.Value) (symbolic.Value, error) + func (s *WebsocketServer) Upgrade(rw *http_ns.ResponseWriter, r *http_ns.Request) (*WebsocketConnection, error) + func (s *WebsocketServer) UpgradeGoValues(rw http.ResponseWriter, r *http.Request, ...) (*WebsocketConnection, error)