Documentation
¶
Index ¶
- Constants
- func BuildWsPkt(pl []byte, code byte) []byte
- type Header
- type UserDataHandler
- type WsClient
- type WsCtx
- type WsHandler
- func (ws *WsHandler) OnClosed(c connection.AppConn, err error)
- func (ws *WsHandler) OnConnected(c connection.ProtoConn)
- func (ws *WsHandler) OnData(c connection.ProtoConn, in *[]byte) (out []byte, close bool)
- func (ws *WsHandler) ParsePacket(c connection.ProtoConn, in *[]byte) (length, expect int)
- func (ws *WsHandler) SetUserDataHandler(uh UserDataHandler)
- func (ws *WsHandler) Stat(bool)
Constants ¶
View Source
const ( MessageNone = iota MessageText MessageBinary )
View Source
const WSHeaderMinSize = 2
Variables ¶
This section is empty.
Functions ¶
func BuildWsPkt ¶
Types ¶
type UserDataHandler ¶
type WsHandler ¶
type WsHandler struct {
// EnablePlainHTTP allows a minimal HTTP response for non-WebSocket GET requests.
// Default is false to preserve strict WebSocket-only behavior.
EnablePlainHTTP bool
// contains filtered or unexported fields
}
func (*WsHandler) OnConnected ¶
func (ws *WsHandler) OnConnected(c connection.ProtoConn)
func (*WsHandler) ParsePacket ¶
func (ws *WsHandler) ParsePacket(c connection.ProtoConn, in *[]byte) (length, expect int)
func (*WsHandler) SetUserDataHandler ¶
func (ws *WsHandler) SetUserDataHandler(uh UserDataHandler)
Click to show internal directories.
Click to hide internal directories.