gf/net/ghttp/ghttp_server_websocket.go

36 lines
1.1 KiB
Go
Raw Normal View History

// Copyright 2018 gf Author(https://github.com/gogf/gf). All Rights Reserved.
//
// 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,
// You can obtain one at https://github.com/gogf/gf.
package ghttp
2019-07-29 21:01:19 +08:00
import "github.com/gogf/gf/internal/thirdparty/github.com/gorilla/websocket"
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
)