Documentation ¶
Index ¶
Constants ¶
View Source
const ( SO_ORIGINAL_DST = 80 IP6T_SO_ORIGINAL_DST = 80 )
View Source
const (
// NAT mode
ModeNAT = "nat"
)
Variables ¶
This section is empty.
Functions ¶
func GetOriginalDST ¶
GetOriginalDST retrieves the original destination address from NATed connection. Currently, only Linux iptables using DNAT/REDIRECT is supported. For other operating systems, this will just return conn.LocalAddr().
Note that this function only works when nf_conntrack_ipv4 and/or nf_conntrack_ipv6 is loaded in the kernel.
Types ¶
type Config ¶
type Config struct { // Listen is the listening address. // e.g. "localhost:1081" Listen string // ProxyURL is the URL for upstream proxy. // // For SOCKS5, URL looks like "socks5://USER:PASSWORD@HOST:PORT". // // For HTTP proxy, URL looks like "http://USER:PASSWORD@HOST:PORT". // The HTTP proxy must support CONNECT method. ProxyURL *url.URL // Mode determines how clients are routed to transocks. // Default is "nat". No other options are available at this point. Mode string // Dialer is the base dialer to connect to the proxy server. // The server uses the default dialer if this is nil. Dialer *net.Dialer }
Config keeps configurations for Server.
Click to show internal directories.
Click to hide internal directories.