Documentation
¶
Overview ¶
Package tun manages transparent VPN tunnels via tun2proxy-bin subprocess.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComplementCIDRs ¶
ComplementCIDRs returns the set of CIDRs covering all of IPv4 (and IPv6, if v6 nets are present) except the provided nets. Passed as --bypass args to tun2proxy to implement "route only these CIDRs" semantics.
func QueryRemoteNets ¶
QueryRemoteNets SSHes to the host and returns its non-default routes as CIDRs. Mirrors sshuttle's server.py list_routes(): `ip route` (Linux) or `netstat -rn` (macOS/BSD).
Types ¶
type Config ¶
type Config struct {
SOCKSHost string
SOCKSPort int
HostName string // display name for the exit node(s)
SSHIPs []string // SSH peer IPs — auto-bypassed as /32
ExtraBypasses []string // user --bypass CIDRs
Nets []string // --nets: route only these (complement becomes bypasses)
}
Config holds everything Run needs to start tun2proxy.
Click to show internal directories.
Click to hide internal directories.