server

package
v0.0.0-...-b66d93a Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type P2PServer

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

func NewP2PServer

func NewP2PServer(wsHandler func(ws *WebSocketConn, request *http.Request)) *P2PServer

func (*P2PServer) Bind

func (server *P2PServer) Bind(conf P2PServerConfig)

type P2PServerConfig

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

func DefaultConfig

func DefaultConfig() P2PServerConfig

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()

func (*WebSocketConn) ReadMessage

func (conn *WebSocketConn) ReadMessage()

func (*WebSocketConn) Send

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

Jump to

Keyboard shortcuts

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