websocket

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDemilitarizedUpgrader added in v1.0.2

func GetDemilitarizedUpgrader(bufferSize int, compression bool) *websocket.Upgrader

GetDemilitarizedUpgrader creates an Upgrader that offers no protection against cross site request forgery (csrf). Only use within demilitarized zones.

Types

type Connection

type Connection interface {
	// Send sends a message
	Send(msgType int, data []byte) error
	// Conn gives access to the underlying connection
	Conn() *websocket.Conn
	// Close closes the connection
	Close()
	// String address of remote endpoint (e.g. "192.0.2.1:25" or "[2001:db8::1]:80")
	String() string
}

Connection represents a connected websocket.

func NewConnection

func NewConnection(conn *websocket.Conn, onMessage func(this Connection, msgType int, data []byte),
	onClose func(this Connection, code int, text string), onError func(this Connection, err error)) Connection

Jump to

Keyboard shortcuts

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