Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MetricsListener ¶ added in v1.3.0
MetricsListener returns a listener for the metrics server.
func NewMetricsServer ¶ added in v1.3.0
NewMetricsServer creates a new metrics.Server.
Types ¶
type AddressGroup ¶
type AddressGroup struct {
// contains filtered or unexported fields
}
AddressGroup is a group of external IP addresses to be used for outgoing connections. With the help of associated goroutines, IP addresses listed on DNSBL will be checked and excluded.
func NewAddressGroup ¶
func NewAddressGroup(addresses []net.IP, dnsblDomain string) *AddressGroup
NewAddressGroup initializes a new AddressGroup and starts helper goroutines.
func (*AddressGroup) PickAddress ¶
func (a *AddressGroup) PickAddress(hint uint32) net.IP
PickAddress returns a local IP address for outgoing connection. hint should be an integer calculated from client and/or target IP addresses.
type Config ¶
type Config struct { Log well.LogConfig `toml:"log"` Incoming IncomingConfig `toml:"incoming"` Outgoing OutgoingConfig `toml:"outgoing"` }
Config is a struct tagged for TOML for usocksd.
type IncomingConfig ¶
type IncomingConfig struct { Port int MetricsPort int `toml:"metrics_port"` Addresses []net.IP AllowFrom []string `toml:"allow_from"` // contains filtered or unexported fields }
IncomingConfig is a set of configurations to accept clients.
type OutgoingConfig ¶
type OutgoingConfig struct { AllowSites []string `toml:"allow_sites"` DenySites []string `toml:"deny_sites"` DenyPorts []int `toml:"deny_ports"` IFace string `toml:"iface"` Addresses []net.IP DNSBLDomain string `toml:"dnsbl_domain"` }
OutgoingConfig is a set of configurations to connect to destinations.