Documentation
¶
Index ¶
- func FromURL(u *url.URL, forward proxy.Dialer) (proxy.Dialer, error)
- type SocksClient
- func (c *SocksClient) Dial(proxyUri *url.URL, address string) (conn *dns.Conn, err error)
- func (c *SocksClient) DialContext(ctx context.Context, proxyUri *url.URL, address string) (conn *dns.Conn, err error)
- func (c *SocksClient) Exchange(m *dns.Msg, proxyUri *url.URL, address string) (*dns.Msg, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SocksClient ¶
func (*SocksClient) DialContext ¶
func (c *SocksClient) DialContext(ctx context.Context, proxyUri *url.URL, address string) (conn *dns.Conn, err error)
DialContext connects to the address on the named network, with a context.Context.
func (*SocksClient) Exchange ¶
Exchange performs a synchronous query. It sends the message m to the address contained in a and waits for a reply. Basic use pattern with a *dns.Client:
c := new(dns.Client) in, rtt, err := c.Exchange(message, "127.0.0.1:53")
Exchange does not retry a failed query, nor will it fall back to TCP in case of truncation. It is up to the caller to create a message that allows for larger responses to be returned. Specifically this means adding an EDNS0 OPT RR that will advertise a larger buffer, see SetEdns0. Messages without an OPT RR will fallback to the historic limit of 512 bytes To specify a local address or a timeout, the caller has to set the `Client.Dialer` attribute appropriately