server

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package server provides a complete tunnel server with health endpoints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// QUIC configuration
	ListenAddr string
	TLSConfig  *tls.Config
	AuthToken  string

	// Resource limits
	MaxConnections int64
	MaxTunnels     int

	// Health endpoints
	HealthAddr string // Address for health HTTP server, e.g., ":8080"

	// Shutdown timeout
	ShutdownTimeout time.Duration
}

Config holds the server configuration.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns a Config with sensible defaults.

type Server

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

Server represents a complete tunnel server with all HA components.

func New

func New(config Config) (*Server, error)

New creates a new tunnel server.

func (*Server) AcquireConnection

func (s *Server) AcquireConnection() error

AcquireConnection attempts to acquire a connection slot.

func (*Server) GetHealthHandler

func (s *Server) GetHealthHandler() *health.Handler

GetHealthHandler returns the health handler for custom health checks.

func (*Server) GetResourceLimiter

func (s *Server) GetResourceLimiter() *limiter.ConnectionLimiter

GetResourceLimiter returns the resource limiter.

func (*Server) GetStats

func (s *Server) GetStats() quic.ServerStats

GetStats returns server statistics.

func (*Server) ReleaseConnection

func (s *Server) ReleaseConnection()

ReleaseConnection releases a connection slot.

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start starts the tunnel server.

func (*Server) Stop

func (s *Server) Stop() error

Stop stops the tunnel server gracefully.

Jump to

Keyboard shortcuts

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