Documentation ¶
Index ¶
- func CheckCloseFrameData(code ws.StatusCode, reason string) error
- func HandleClose(h *ws.Header, payload []byte) ([]byte, error)
- func HandlePing(payload []byte) ([]byte, error)
- func HandlePong(payload []byte) ([]byte, error)
- func PackCloseData(reason string) ([]byte, error)
- func PackData(messageType ws.MessageType, data []byte) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckCloseFrameData ¶
func CheckCloseFrameData(code ws.StatusCode, reason string) error
CheckCloseFrameData checks received close information to be valid RFC6455 compatible close info.
Note that code.Empty() or code.IsAppLevel() will raise error.
If endpoint sends close frame without status code (with frame.Length = 0), application should not check its payload.
func HandleClose ¶
HandleClose 处理 websocket close 返回应答信息
func PackCloseData ¶
PackCloseData 封装 websocket close 数据包
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.