2019-02-02 16:18:25 +08:00
|
|
|
// Copyright 2018 gf Author(https://github.com/gogf/gf). All Rights Reserved.
|
2018-06-02 23:47:16 +08:00
|
|
|
//
|
|
|
|
// This Source Code Form is subject to the terms of the MIT License.
|
|
|
|
// If a copy of the MIT was not distributed with this file,
|
2019-02-02 16:18:25 +08:00
|
|
|
// You can obtain one at https://github.com/gogf/gf.
|
2018-06-02 23:47:16 +08:00
|
|
|
|
|
|
|
package ghttp
|
|
|
|
|
2019-07-29 21:01:19 +08:00
|
|
|
import "github.com/gogf/gf/internal/thirdparty/github.com/gorilla/websocket"
|
2018-06-02 23:47:16 +08:00
|
|
|
|
|
|
|
type WebSocket struct {
|
2019-06-19 09:06:52 +08:00
|
|
|
*websocket.Conn
|
2018-08-31 23:53:57 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
const (
|
2019-06-19 09:06:52 +08:00
|
|
|
// TextMessage denotes a text data message. The text message payload is
|
|
|
|
// interpreted as UTF-8 encoded text data.
|
|
|
|
WS_MSG_TEXT = websocket.TextMessage
|
|
|
|
|
|
|
|
// BinaryMessage denotes a binary data message.
|
|
|
|
WS_MSG_BINARY = websocket.BinaryMessage
|
|
|
|
|
|
|
|
// CloseMessage denotes a close control message. The optional message
|
|
|
|
// payload contains a numeric code and text. Use the FormatCloseMessage
|
|
|
|
// function to format a close message payload.
|
|
|
|
WS_MSG_CLOSE = websocket.CloseMessage
|
|
|
|
|
|
|
|
// PingMessage denotes a ping control message. The optional message payload
|
|
|
|
// is UTF-8 encoded text.
|
|
|
|
WS_MSG_PING = websocket.PingMessage
|
|
|
|
|
|
|
|
// PongMessage denotes a pong control message. The optional message payload
|
|
|
|
// is UTF-8 encoded text.
|
|
|
|
WS_MSG_PONG = websocket.PongMessage
|
|
|
|
)
|