Versions in this module Expand all Collapse all v0 v0.1.0 Jun 4, 2018 Changes in this version + const BinaryMessage + const CloseMessage + const PingMessage + const PongMessage + const TextMessage + var ErrBadHandshake = errors.New("bad handshake") + var ErrControlFragmented = errors.New("control message can not be fragmented") + var ErrControlTooLong = errors.New("control message too long") + var ErrHijacker = errors.New("Not implement http.Hijacker") + var ErrInvalidConnection = errors.New("\"Connection\" must be \"Upgrade\"") + var ErrInvalidMethod = errors.New("Only GET Supported") + var ErrInvalidUpgrade = errors.New("Can \"Upgrade\" only to \"WebSocket\"") + var ErrInvalidVersion = errors.New("Sec-Websocket-Version: 13") + var ErrMissingKey = errors.New("Missing Key") + var ErrNoEmptyConn = errors.New("Conn ReadBuf must be empty") + var ErrNotTCPConn = errors.New("not a tcp connection") + var ErrPayloadError = errors.New("payload length error") + var ErrRSVNotSupport = errors.New("reserved bit not support") + var ErrWriteError = errors.New("write error") + func HandleCloseFrame(buf []byte) (int16, string, error) + type Conn struct + func NewClient(netConn net.Conn, u *url.URL, requestHeader http.Header) (c *Conn, response *http.Response, err error) + func NewConn(conn net.Conn, isServer bool) *Conn + func Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header) (*Conn, error) + func (c *Conn) Close() error + func (c *Conn) LocalAddr() net.Addr + func (c *Conn) Ping(message []byte) error + func (c *Conn) Pong(message []byte) error + func (c *Conn) Read() (messageType byte, message []byte, err error) + func (c *Conn) ReadMessage() (messageType byte, message []byte, err error) + func (c *Conn) RemoteAddr() net.Addr + func (c *Conn) SetReadBuffer(bytes int) error + func (c *Conn) SetReadDeadline(t time.Time) error + func (c *Conn) SetWriteBuffer(bytes int) error + func (c *Conn) SetWriteDeadline(t time.Time) error + func (c *Conn) Write(message []byte, binary bool) error + func (c *Conn) WriteBinary(message []byte) error + func (c *Conn) WriteMessage(messageType byte, message []byte) error + func (c *Conn) WriteString(message []byte) error