Versions in this module Expand all Collapse all v1 v1.3.0 Jul 1, 2019 v1.2.0 Mar 17, 2018 Changes in this version + const BinaryMessage + const CloseAbnormalClosure + const CloseGoingAway + const CloseInternalServerErr + const CloseInvalidFramePayloadData + const CloseMandatoryExtension + const CloseMessage + const CloseMessageTooBig + const CloseNoStatusReceived + const CloseNormalClosure + const ClosePolicyViolation + const CloseProtocolError + const CloseServiceRestart + const CloseTLSHandshake + const CloseTryAgainLater + const CloseUnsupportedData + const PingMessage + const PongMessage + const TextMessage + var DefaultDialer = &Dialer + var ErrBadHandshake = errors.New("websocket: bad handshake") + var ErrCloseSent = errors.New("websocket: close sent") + var ErrReadLimit = errors.New("websocket: read limit exceeded") + func FormatCloseMessage(closeCode int, text string) []byte + func IsCloseError(err error, codes ...int) bool + func IsUnexpectedCloseError(err error, expectedCodes ...int) bool + func IsWebSocketUpgrade(r *http.Request) bool + func ReadJSON(c *Conn, v interface{}) error + func Subprotocols(r *http.Request) []string + func WriteJSON(c *Conn, v interface{}) error + type CloseError struct + Code int + Text string + func (e *CloseError) Error() string + type Conn struct + func NewClient(netConn net.Conn, u *url.URL, requestHeader http.Header, ...) (c *Conn, response *http.Response, err error) + func Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header, ...) (*Conn, error) + func (c *Conn) Close() error + func (c *Conn) CloseHandler() func(code int, text string) error + func (c *Conn) EnableWriteCompression(enable bool) + func (c *Conn) LocalAddr() net.Addr + func (c *Conn) NextReader() (messageType int, r io.Reader, err error) + func (c *Conn) NextWriter(messageType int) (io.WriteCloser, error) + func (c *Conn) PingHandler() func(appData string) error + func (c *Conn) PongHandler() func(appData string) error + func (c *Conn) ReadJSON(v interface{}) error + func (c *Conn) ReadMessage() (messageType int, p []byte, err error) + func (c *Conn) RemoteAddr() net.Addr + func (c *Conn) SetCloseHandler(h func(code int, text string) error) + func (c *Conn) SetPingHandler(h func(appData string) error) + func (c *Conn) SetPongHandler(h func(appData string) error) + func (c *Conn) SetReadDeadline(t time.Time) error + func (c *Conn) SetReadLimit(limit int64) + func (c *Conn) SetWriteDeadline(t time.Time) error + func (c *Conn) Subprotocol() string + func (c *Conn) UnderlyingConn() net.Conn + func (c *Conn) WriteControl(messageType int, data []byte, deadline time.Time) error + func (c *Conn) WriteJSON(v interface{}) error + func (c *Conn) WriteMessage(messageType int, data []byte) error + type Dialer struct + EnableCompression bool + HandshakeTimeout time.Duration + Jar http.CookieJar + NetDial func(network, addr string) (net.Conn, error) + Proxy func(*http.Request) (*url.URL, error) + ReadBufferSize int + Subprotocols []string + TLSClientConfig *tls.Config + WriteBufferSize int + func (d *Dialer) Dial(urlStr string, requestHeader http.Header) (*Conn, *http.Response, error) + type HandshakeError struct + func (e HandshakeError) Error() string + type Upgrader struct + CheckOrigin func(r *http.Request) bool + EnableCompression bool + Error func(w http.ResponseWriter, r *http.Request, status int, reason error) + HandshakeTimeout time.Duration + ReadBufferSize int + Subprotocols []string + WriteBufferSize int + func (u *Upgrader) FayUpgrade(ctx *faygo.Context, responseHeader http.Header) (*Conn, error) + func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header) (*Conn, error)