Versions in this module Expand all Collapse all v0 v0.20240905.1 Sep 5, 2024 v0.20240905.0 Sep 5, 2024 Changes in this version + const BinaryFrame + const CloseFrame + const ContinuationFrame + const DefaultMaxPayloadBytes + const PingFrame + const PongFrame + const ProtocolVersionHybi + const ProtocolVersionHybi13 + const SupportedProtocolVersion + const TextFrame + const UnknownFrame + var ErrBadClosingStatus = &ProtocolError + var ErrBadFrame = &ProtocolError + var ErrBadFrameBoundary = &ProtocolError + var ErrBadMaskingKey = &ProtocolError + var ErrBadPongMessage = &ProtocolError + var ErrBadProtocolVersion = &ProtocolError + var ErrBadRequestMethod = &ProtocolError + var ErrBadScheme = &ProtocolError + var ErrBadStatus = &ProtocolError + var ErrBadUpgrade = &ProtocolError + var ErrBadWebSocketLocation = &ProtocolError + var ErrBadWebSocketOrigin = &ProtocolError + var ErrBadWebSocketProtocol = &ProtocolError + var ErrBadWebSocketVersion = &ProtocolError + var ErrChallengeResponse = &ProtocolError + var ErrFrameTooLarge = errors.New("websocket: frame payload size exceeds limit") + var ErrNotImplemented = &ProtocolError + var ErrNotSupported = &ProtocolError + var ErrNotWebSocket = &ProtocolError + var ErrUnsupportedExtensions = &ProtocolError + var JSON = Codec + var Message = Codec + func Origin(config *Config, req *http.Request) (*url.URL, error) + type Addr struct + func (addr *Addr) Network() string + type Codec struct + Marshal func(v interface{}) (data []byte, payloadType byte, err error) + Unmarshal func(data []byte, payloadType byte, v interface{}) (err error) + func (cd Codec) Receive(ws *Conn, v interface{}) (err error) + func (cd Codec) Send(ws *Conn, v interface{}) (err error) + type Config struct + Dialer *net.Dialer + Header http.Header + Location *url.URL + Origin *url.URL + Protocol []string + TlsConfig *tls.Config + Version int + func NewConfig(server, origin string) (config *Config, err error) + type Conn struct + MaxPayloadBytes int + PayloadType byte + func Dial(url_, protocol, origin string) (ws *Conn, err error) + func DialConfig(config *Config) (ws *Conn, err error) + func NewClient(config *Config, rwc io.ReadWriteCloser) (ws *Conn, err error) + func (ws *Conn) Close() error + func (ws *Conn) Config() *Config + func (ws *Conn) IsClientConn() bool + func (ws *Conn) IsServerConn() bool + func (ws *Conn) LocalAddr() net.Addr + func (ws *Conn) Read(msg []byte) (n int, err error) + func (ws *Conn) RemoteAddr() net.Addr + func (ws *Conn) Request() *http.Request + func (ws *Conn) SetDeadline(t time.Time) error + func (ws *Conn) SetReadDeadline(t time.Time) error + func (ws *Conn) SetWriteDeadline(t time.Time) error + func (ws *Conn) Write(msg []byte) (n int, err error) + type DialError struct + Err error + func (e *DialError) Error() string + type Handler func(*Conn) + func (h Handler) ServeHTTP(w http.ResponseWriter, req *http.Request) + type ProtocolError struct + ErrorString string + func (err *ProtocolError) Error() string + type Server struct + Handshake func(*Config, *http.Request) error + func (s Server) ServeHTTP(w http.ResponseWriter, req *http.Request)