Documentation
¶
Index ¶
- Constants
- type WebSocket
- func (ws *WebSocket) Close() error
- func (ws *WebSocket) CloseCode() uint16
- func (ws *WebSocket) Err() error
- func (ws *WebSocket) Next() bool
- func (ws *WebSocket) Opcode() uint8
- func (ws *WebSocket) Payload() []byte
- func (ws *WebSocket) Read(b []byte) (int, error)
- func (ws *WebSocket) SetCloseCode(cc uint16) error
- func (ws *WebSocket) SetWriteOpcode(opcode uint8)
- func (w WebSocket) Write(b []byte) (int, error)
Constants ¶
View Source
const ( OpcodeText = 0x1 OpcodeBinary = 0x2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WebSocket ¶
type WebSocket struct {
// contains filtered or unexported fields
}
WebSocket is a websocket instance that may be either a client or a server depending on how it is created.
func Open ¶
Open creates a WebSocket instance in client mode. The address must use either "ws" or "wss" protocols. If the port is omitted, it assumes port 80 for "ws" and port 443 for "wss".
func UpgradeHTTP ¶
UpgradeHTTP switches the protocol from HTTP to the WebSocket Protocol.
func (*WebSocket) SetCloseCode ¶
func (*WebSocket) SetWriteOpcode ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.