websocket

package
v0.0.0-...-945c0d7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WebSocketConn

type WebSocketConn struct {
	emission.Emitter
	// contains filtered or unexported fields
}

func NewWebSocketConn

func NewWebSocketConn(socket *websocket.Conn) *WebSocketConn

func (*WebSocketConn) Close

func (conn *WebSocketConn) Close()

* Close conn.

func (*WebSocketConn) ReadMessage

func (conn *WebSocketConn) ReadMessage()

func (*WebSocketConn) Send

func (conn *WebSocketConn) Send(message string) error

* Send |message| to the connection.

type WebSocketServer

type WebSocketServer struct {
	// contains filtered or unexported fields
}

func NewWebSocketServer

func NewWebSocketServer(
	wsHandler func(ws *WebSocketConn, request *http.Request),
	turnServerHandler func(writer http.ResponseWriter, request *http.Request)) *WebSocketServer

func (*WebSocketServer) Bind

func (server *WebSocketServer) Bind(cfg WebSocketServerConfig)

Bind .

type WebSocketServerConfig

type WebSocketServerConfig struct {
	Host           string
	Port           int
	CertFile       string
	KeyFile        string
	HTMLRoot       string
	WebSocketPath  string
	TurnServerPath string
}

func DefaultConfig

func DefaultConfig() WebSocketServerConfig

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL