Versions in this module Expand all Collapse all v1 v1.0.0 Jul 28, 2016 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(ctx *fasthttp.RequestCtx) bool + func ReadJSON(c *Conn, v interface{}) error + func Subprotocols(ctx *fasthttp.RequestCtx) []string + func Upgrade(ctx *fasthttp.RequestCtx, readBufSize, writeBufSize int) error + 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 (c *Conn) Close() error + 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) 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 + HandshakeTimeout time.Duration + 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(ctx *fasthttp.RequestCtx) bool + Error func(ctx *fasthttp.RequestCtx, status int, reason error) + Handler func(*Conn) + HandshakeTimeout time.Duration + ReadBufferSize int + Subprotocols []string + WriteBufferSize int + func (u *Upgrader) Upgrade(ctx *fasthttp.RequestCtx, handlers ...func(*Conn)) error