Documentation
¶
Overview ¶
Package resolver constructs *net.Resolver instances with optional SOCKS5 proxy support to prevent DNS leaks when the user configures a SOCKS5 proxy.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewResolver ¶
NewResolver returns a *net.Resolver appropriate for the given proxy URL.
When proxyURL is empty, the ALL_PROXY environment variable is consulted via proxy.FromEnvironment(). If it resolves to a SOCKS5 dialer, DNS queries are tunnelled through it. HTTP/HTTPS proxies are intentionally ignored for DNS (only SOCKS5 can proxy raw TCP DNS traffic). If no usable proxy is found, the standard system resolver is returned (nil Dial field).
When proxyURL is a non-empty non-socks5 URL, the standard system resolver is returned.
When proxyURL is a socks5:// URL, DNS queries are tunnelled through the SOCKS5 proxy using DNS-over-TCP, preventing DNS leaks to the local ISP.
Types ¶
This section is empty.