server

package
v1.29.3 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Version         string
	Domain          string
	Port            int
	TCPPort         int
	Secure          bool
	Token           types.GetToken
	Notification    *client.NotificationConfig
	BandwidthLimits *limiter.ClientBandwidthLimits
	// PublicHTTPNoAuthSessionTTL: max lifetime for public (unauthenticated) monitor clients.
	// Zero means default 10m. Independent of tunnel type and public URL auth.
	PublicHTTPNoAuthSessionTTL time.Duration
	// PublicHTTPNoAuthWarnLeadTime: lead time before close warning.
	// Zero means default 2m.
	PublicHTTPNoAuthWarnLeadTime time.Duration
	ConfigPath                   string
	ReloadManager                *config.Manager
	Admin                        *config.ResolvedAdmin
	PidFile                      string
}

Options contains options for creating a server

type Server

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

Server represents the main server instance

func New

func New(options Options) (*Server, error)

New creates and initializes a new server instance

func (*Server) AdminServer added in v1.29.0

func (s *Server) AdminServer() *admin.Server

AdminServer returns the admin console server when enabled.

func (*Server) ReconcileAdmin added in v1.29.3

func (s *Server) ReconcileAdmin(cfg *config.FileConfig) error

ReconcileAdmin (re)starts the admin HTTP listener when admin.listen or related settings change. Hot reload updates tunnel auth and limits but admin binds its own socket at startup; without this, saving 0.0.0.0:9090 in the UI would not take effect until process restart.

func (*Server) SetReloadManager added in v1.29.0

func (s *Server) SetReloadManager(m *config.Manager)

SetReloadManager attaches the hot-reload manager after construction.

func (*Server) Start

func (s *Server) Start() error

Start starts the server

func (*Server) Stop

func (s *Server) Stop() error

func (*Server) UpdateConfig

func (s *Server) UpdateConfig(
	getToken types.GetToken,
	notificationConfig *client.NotificationConfig,
	bandwidthLimits *limiter.ClientBandwidthLimits,
	publicHTTPNoAuthSessionTTL time.Duration,
	publicHTTPNoAuthWarnLeadTime time.Duration,
) error

UpdateConfig updates the server configuration dynamically

type WebSocketMonitor

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

WebSocketMonitor manages WebSocket connections and authentication

func CreateWebSocketMonitor

func CreateWebSocketMonitor(ctx *types.Context, options *monitorchannel.CreateWebSocketOptions) *WebSocketMonitor

CreateWebSocketMonitor creates a new WebSocket monitor

func (*WebSocketMonitor) Attach

func (m *WebSocketMonitor) Attach(server *http.Server)

Attach attaches the WebSocket monitor to an HTTP server

func (*WebSocketMonitor) OnTunnel

func (m *WebSocketMonitor) OnTunnel(handler func(data map[string]interface{}))

OnTunnel registers a handler for tunnel events

Directories

Path Synopsis
channels

Jump to

Keyboard shortcuts

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