Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Frame ¶
type Frame struct {
Header FrameHeader
Data io.Reader
}
type FrameHeader ¶
type FrameHeader struct {
Fin bool
Rsv1 bool
Rsv2 bool
Rsv3 bool
OpCode OpCode
PayloadLength int64
Masked bool
MaskKey uint32
}
FrameHeader represents a WebSocket frame header. See https://tools.ietf.org/html/rfc6455#section-5.2.
func (FrameHeader) Length ¶
func (h FrameHeader) Length() int
func (*FrameHeader) ReadFrom ¶
func (h *FrameHeader) ReadFrom(r io.Reader) (n int64, err error)
ReadFrom reads a header from the reader. See https://tools.ietf.org/html/rfc6455#section-5.2.
type WebsocketConn ¶
type WebsocketConn interface {
net.Conn
WriteMessage(int, []byte) error
ReadMessage() (int, []byte, error)
xnet.ClientAddr
}
func Conn ¶
func Conn(conn *websocket.Conn) WebsocketConn
func ConnWithClientAddr ¶
func ConnWithClientAddr(conn *websocket.Conn, clientAddr net.Addr) WebsocketConn
Click to show internal directories.
Click to hide internal directories.