servers

package
v0.0.0-...-ab6dc77 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: BSD-3-Clause Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const ReadHeaderTimeout = time.Duration(10) * time.Second

Variables

View Source
var ErrNoServeWaitsLeft = errors.New("no serve waits left")

Functions

This section is empty.

Types

type MaxConnectionsPerUserEnum

type MaxConnectionsPerUserEnum = int
const (
	MaxConnectionsPerUserKillOldest MaxConnectionsPerUserEnum = 0
	MaxConnectionsPerUserPreventNew MaxConnectionsPerUserEnum = 1
)

type Server

type Server struct {
	shared.EventConfigHolder

	PacketHandler             sockets.PacketHandler
	VPNNet                    *shared.VPNNet
	DoLocalIPConfig           bool
	DoRemoteIPConfig          bool
	TLSConfig                 *tls.Config
	ListenAddr                string
	HTTP3Enabled              bool
	Authenticator             authenticators.Authenticator
	Mode                      shared.VPNMode
	SocketConfigurator        sockets.SocketConfigurator
	InterfaceConfig           *iface.InterfaceConfig
	MaxConnectionsPerUser     int
	MaxConnectionsPerUserMode MaxConnectionsPerUserEnum
	WebsiteDirectory          string
	APIEnabled                bool
	APIUsers                  map[string]bool
	PreauthorizeSecret        []byte
	// contains filtered or unexported fields
}

func NewServer

func NewServer() *Server

func (*Server) Close

func (s *Server) Close()

func (*Server) Serve

func (s *Server) Serve() error

func (*Server) SetHeaders

func (s *Server) SetHeaders(headers http.Header)

func (*Server) SetLocalFeature

func (s *Server) SetLocalFeature(feature features.Feature, enabled bool)

func (*Server) SetMTU

func (s *Server) SetMTU(mtu int) error

func (*Server) SetServerID

func (s *Server) SetServerID(serverID string)

func (*Server) UpdateSocketConfig

func (s *Server) UpdateSocketConfig() error

type SocketStruct

type SocketStruct struct {
	ClientID   string `json:"client_id"`
	Protocol   string `json:"protocol"`
	VPNIP      string `json:"vpn_ip"`
	LocalAddr  string `json:"local_addr"`
	RemoteAddr string `json:"remote_addr"`
	Username   string `json:"username"`
}

Jump to

Keyboard shortcuts

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