websocket

package
v0.0.0-...-560f09a Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func New

func New(dialer Dialer, inactiveTimeout time.Duration) *Cache

New creates a new workspace connection cache that closes connections after the inactive timeout provided.

Agent connections are cached due to WebRTC negotiation taking a few hundred milliseconds.

type Dialer

type Dialer func(r *http.Request, id int64) (*SocketConn, error)

Dialer creates a new agent connection by ID.

type Socket

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

Socket

wraps a websocket connection with a reusable HTTP transport.

func (*Socket) HTTPTransport

func (s *Socket) HTTPTransport() *http.Transport

type SocketConn

type SocketConn struct {
	Conn *websocket.Conn
	Id   string

	CloseFunc func()
}

Jump to

Keyboard shortcuts

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