Versions in this module Expand all Collapse all v0 v0.0.1 May 16, 2020 Changes in this version + const DefaultPayloadSize + const StatusGoAway + const StatusNone + const StatusNotAcceptable + const StatusNotConsistent + const StatusProtocolError + const StatusReserved + const StatusTooBig + const StatusUnexpected + const StatusViolation + const StatuseExtensionsNeeded + var EOF = io.EOF + var ErrCannotUpgrade = errors.New("cannot upgrade connection") + func NetUpgrade(handler RequestHandler) func(http.ResponseWriter, *http.Request) + func ReleaseFrame(fr *Frame) + func Upgrade(handler RequestHandler) func(ctx *fasthttp.RequestCtx) + type Code uint8 + const CodeBinary + const CodeClose + const CodeContinuation + const CodePing + const CodePong + const CodeText + type Conn struct + MaxPayloadSize uint64 + Mode Mode + ReadTimeout time.Duration + WriteTimeout time.Duration + func Client(c net.Conn, url string) (*Conn, error) + func ClientWithHeaders(c net.Conn, url string, req *fasthttp.Request) (*Conn, error) + func Dial(url string) (*Conn, error) + func DialWithHeaders(url string, req *fasthttp.Request) (*Conn, error) + func (conn *Conn) Close() error + func (conn *Conn) CloseString(b string) error + func (conn *Conn) LocalAddr() net.Addr + func (conn *Conn) NextFrame() (fr *Frame, err error) + func (conn *Conn) ReadFrame(fr *Frame) (nn int, err error) + func (conn *Conn) ReadFull(b []byte, fr *Frame) ([]byte, error) + func (conn *Conn) ReadMessage(b []byte) (Mode, []byte, error) + func (conn *Conn) RemoteAddr() net.Addr + func (conn *Conn) ReplyClose(fr *Frame) (err error) + func (conn *Conn) Reset(c net.Conn) + func (conn *Conn) SendCode(code Code, status StatusCode, b []byte) error + func (conn *Conn) SendCodeString(code Code, status StatusCode, b string) error + func (conn *Conn) SetUserValue(key string, value interface{}) + func (conn *Conn) UserValue(key string) interface{} + func (conn *Conn) Write(b []byte) (int, error) + func (conn *Conn) WriteFrame(fr *Frame) (int, error) + func (conn *Conn) WriteMessage(mode Mode, b []byte) (int, error) + func (conn *Conn) WriteString(b string) (int, error) + type Frame struct + func AcquireFrame() *Frame + func (fr *Frame) Code() Code + func (fr *Frame) CopyTo(fr2 *Frame) + func (fr *Frame) HasRSV1() bool + func (fr *Frame) HasRSV2() bool + func (fr *Frame) HasRSV3() bool + func (fr *Frame) IsClose() bool + func (fr *Frame) IsContinuation() bool + func (fr *Frame) IsControl() bool + func (fr *Frame) IsFin() bool + func (fr *Frame) IsMasked() bool + func (fr *Frame) IsPing() bool + func (fr *Frame) IsPong() bool + func (fr *Frame) Len() (length uint64) + func (fr *Frame) Mask() + func (fr *Frame) MaskKey() []byte + func (fr *Frame) Mode() (mode Mode) + func (fr *Frame) Payload() []byte + func (fr *Frame) PayloadLen() int + func (fr *Frame) PayloadSize() uint64 + func (fr *Frame) ReadFrom(rd io.Reader) (int64, error) + func (fr *Frame) Reset() + func (fr *Frame) SetBinary() + func (fr *Frame) SetClose() + func (fr *Frame) SetCode(code Code) + func (fr *Frame) SetContinuation() + func (fr *Frame) SetFin() + func (fr *Frame) SetMask(b []byte) + func (fr *Frame) SetPayload(b []byte) + func (fr *Frame) SetPayloadSize(size uint64) + func (fr *Frame) SetPing() + func (fr *Frame) SetPong() + func (fr *Frame) SetRSV1() + func (fr *Frame) SetRSV2() + func (fr *Frame) SetRSV3() + func (fr *Frame) SetStatus(status StatusCode) + func (fr *Frame) SetText() + func (fr *Frame) Status() (status StatusCode) + func (fr *Frame) String() string + func (fr *Frame) Unmask() + func (fr *Frame) UnsetMask() + func (fr *Frame) Write(b []byte) (int, error) + func (fr *Frame) WriteTo(wr io.Writer) (n int64, err error) + type Mode uint8 + const ModeBinary + const ModeText + type NetUpgradeHandler func(resp http.ResponseWriter, req *http.Request) bool + type NetUpgrader struct + Compress bool + Handler RequestHandler + Origin string + Protocols []string + UpgradeHandler NetUpgradeHandler + func (upgr *NetUpgrader) Upgrade(resp http.ResponseWriter, req *http.Request) + type RequestHandler func(conn *Conn) + type StatusCode uint16 + type UpgradeHandler func(*fasthttp.RequestCtx) bool + type Upgrader struct + Compress bool + Handler RequestHandler + Origin string + Protocols []string + UpgradeHandler UpgradeHandler + func (upgr *Upgrader) Upgrade(ctx *fasthttp.RequestCtx)