github.com/gogf/gf/v2@v2.7.4/net/ghttp/ghttp_server_websocket.go (about)

     1  // Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
     2  //
     3  // This Source Code Form is subject to the terms of the MIT License.
     4  // If a copy of the MIT was not distributed with this file,
     5  // You can obtain one at https://github.com/gogf/gf.
     6  
     7  package ghttp
     8  
     9  import "github.com/gorilla/websocket"
    10  
    11  // WebSocket wraps the underlying websocket connection
    12  // and provides convenient functions.
    13  //
    14  // Deprecated: will be removed in the future, please use third-party websocket library instead.
    15  type WebSocket struct {
    16  	*websocket.Conn
    17  }
    18  
    19  const (
    20  	// WsMsgText TextMessage denotes a text data message.
    21  	// The text message payload is interpreted as UTF-8 encoded text data.
    22  	WsMsgText = websocket.TextMessage
    23  
    24  	// WsMsgBinary BinaryMessage denotes a binary data message.
    25  	WsMsgBinary = websocket.BinaryMessage
    26  
    27  	// WsMsgClose CloseMessage denotes a close control message.
    28  	// The optional message payload contains a numeric code and text.
    29  	// Use the FormatCloseMessage function to format a close message payload.
    30  	WsMsgClose = websocket.CloseMessage
    31  
    32  	// WsMsgPing PingMessage denotes a ping control message.
    33  	// The optional message payload is UTF-8 encoded text.
    34  	WsMsgPing = websocket.PingMessage
    35  
    36  	// WsMsgPong PongMessage denotes a pong control message.
    37  	// The optional message payload is UTF-8 encoded text.
    38  	WsMsgPong = websocket.PongMessage
    39  )