Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Port string
ListenIP string
RequireAuth bool
AllowedDestFqdn string
AllowedIPs []string
ReadTimeout time.Duration
WriteTimeout time.Duration
MaxConnections int
Fail2BanRetries int
Fail2BanTime time.Duration
Logger *slog.Logger
Telemetry *Telemetry // Optional custom telemetry
// Obfuscation settings
ObfsEnabled bool
ObfsPort string // Separate port for obfuscated connections
ObfsPSK string
ObfsMaxPadding int
ObfsMTU int
// Multi-account settings
UsersFile string // Path to JSON file with user accounts
TrafficFlushInterval time.Duration // Interval for flushing traffic counters to disk
}
Config represents the configuration for the SOCKS5 server.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns a configuration with sensible defaults.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents a controllable SOCKS5 server instance.
func (*Server) ReloadUsers ¶ added in v1.4.4
ReloadUsers reloads the user store from the configured file. Traffic counters are preserved across reloads.
func (*Server) RemoveUser ¶
RemoveUser removes a user from authentication
func (*Server) UpdateWhitelist ¶
UpdateWhitelist updates allowed IPs on the fly
type Telemetry ¶
type Telemetry struct {
ActiveConnections metric.Int64UpDownCounter
TotalConnections metric.Int64Counter
AuthFailures metric.Int64Counter
BytesIn metric.Int64Counter
BytesOut metric.Int64Counter
}
Telemetry holds OpenTelemetry instruments
func InitTelemetry ¶
func InitTelemetry(meterProvider metric.MeterProvider) (*Telemetry, error)
InitTelemetry initializes standard OpenTelemetry metrics
Click to show internal directories.
Click to hide internal directories.