Versions in this module Expand all Collapse all v0 v0.1.15 Jan 3, 2023 v0.1.14 Jan 3, 2023 Changes in this version + const BinaryMessage + const CloseMessage + const PingMessage + const PongMessage + const TextMessage + var ErrBadRequestMethod = errors.New("bad method") + var ErrBadWebSocketVersion = errors.New("missing or bad WebSocket Version") + var ErrChallengeResponse = errors.New("mismatch challenge/response") + var ErrMessageClose = errors.New("close control message") + var ErrMessageMaxRead = errors.New("continuation frame max read") + var ErrNotWebSocket = errors.New("not websocket protocol") + type Conn struct + func Upgrade(rwc net.Conn, rr *bufio.Reader, wr *bufio.Writer, req *Request) (conn *Conn, err error) + func (c *Conn) Discard(n int) (int, error) + func (c *Conn) Flush() error + func (c *Conn) Peek(n int) ([]byte, error) + func (c *Conn) PeekByte() (uint8, error) + func (c *Conn) PeekUint32() (uint32, error) + func (c *Conn) Read(p []byte) (n int, err error) + func (c *Conn) ReadMessage() (op int, payload []byte, err error) + func (c *Conn) Write(p []byte) (n int, err error) + func (c *Conn) WriteBody(b []byte) (err error) + func (c *Conn) WriteHeader(msgType int, length int) (err error) + func (c *Conn) WriteMessage(msgType int, msg []byte) (err error) + type Request struct + Header http.Header + Host string + Method string + Proto string + RequestURI string + func ReadRequest(r *bufio.Reader) (req *Request, err error)