iface

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	ID() string
	// AddClient associates a client connection and informs the backend about it.
	// The hostname indicates which virtual host this client targets.
	AddClient(clientConn net.Conn, clientID uuid.UUID, hostname string, isTLS bool) error
	RemoveClient(clientID uuid.UUID)
	SendData(clientID uuid.UUID, data []byte) error
}

Backend represents a single connection from a backend service.

type Hub

type Hub interface {
	GetLocalRoutes() []string
	SelectBackend(hostname string) (Backend, error)
	UDPFlowIdleTimeout(port int) (time.Duration, bool)
	GetBandwidthScheduler() *bandwidth.Scheduler
}

Hub is an interface that components use to interact with the backend hub.

type Peer

type Peer interface {
	Addr() string
	Send(message []byte) bool
	StartTunnel(conn net.Conn, hostname string, isTLS bool)
}

Peer represents a single connection to another Nexus node.

type PeerManager

type PeerManager interface {
	HandleInboundPeer(conn *websocket.Conn)
	AnnounceLocalRoutes()
	GetPeerForHostname(hostname string) (Peer, bool)
	HandleTunnelRequest(p Peer, hostname string, clientID uuid.UUID, clientIP string, connPort int, isTLS bool)
	ForwardUDP(routeKey string, dstPort int, pc net.PacketConn, clientAddr *net.UDPAddr, payload []byte) error
}

PeerManager is an interface that components use to interact with the peer manager.

Jump to

Keyboard shortcuts

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