Versions in this module Expand all Collapse all v1 v1.8.12 Aug 9, 2024 Changes in this version + type CloseEvent struct — js/wasm + Code uint16 + Reason string + WasClean bool + type MessageEvent struct — js/wasm + Data interface{} + type WebSocket struct — js/wasm + func New(url string, protocols []string) (c WebSocket, err error) + func (c WebSocket) Close(code int, reason string) (err error) + func (c WebSocket) OnClose(fn func(CloseEvent)) (remove func()) + func (c WebSocket) OnError(fn func(e js.Value)) (remove func()) + func (c WebSocket) OnMessage(fn func(m MessageEvent)) (remove func()) + func (c WebSocket) OnOpen(fn func(e js.Value)) (remove func()) + func (c WebSocket) SendBytes(v []byte) (err error) + func (c WebSocket) SendText(v string) (err error) + func (c WebSocket) Subprotocol() string