server

package
v0.2.0-dev Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogLevelDebug = "debug"
	LogLevelError = "error"
	LogLevelInfo  = "info"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	LogLevel string
}

type ConnectionConfig

type ConnectionConfig struct {
	Handshake    uint32 `mapstructure:"handshake"`
	ConnIdle     uint32 `mapstructure:"connIdle"`
	UplinkOnly   uint32 `mapstructure:"uplinkOnly"`
	DownlinkOnly uint32 `mapstructure:"downlinkOnly"`
	BufferSize   int32  `mapstructure:"bufferSize"`
}

type ExtConfig

type ExtConfig struct {
	Outbounds []serverConfigOutboundEntry `mapstructure:"outbounds"`
	ACL       serverConfigACL             `mapstructure:"acl"`
	Sniff     serverConfigSniff           `mapstructure:"sniff"`
}

type GeoLoader

type GeoLoader struct {
	GeoIPFilename   string
	GeoSiteFilename string
	UpdateInterval  time.Duration

	DownloadFunc    func(filename, url string)
	DownloadErrFunc func(err error)
	// contains filtered or unexported fields
}

GeoLoader provides the on-demand GeoIP/GeoSite database loading functionality required by the ACL engine. Empty filenames = automatic download from built-in URLs.

func (*GeoLoader) LoadGeoIP

func (l *GeoLoader) LoadGeoIP() (map[string]*v2geo.GeoIP, error)

func (*GeoLoader) LoadGeoSite

func (l *GeoLoader) LoadGeoSite() (map[string]*v2geo.GeoSite, error)

type Server

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

func New

func New(config *Config, apiConfig *api.Config, serviceConfig *service.Config, extConfig *ExtConfig) (*Server, error)

func (*Server) Close

func (s *Server) Close()

func (*Server) Start

func (s *Server) Start() error

Jump to

Keyboard shortcuts

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