interceptor

package
v0.0.0-...-67cf1be Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(domains ...names.FQDN)

Setup installs the interceptor into net.DefaultResolver.

Types

type Dialer

type Dialer struct {
	// MulticastDomains is a set of fully-qualified names that should be queried
	// via multicast. If it is empty, "local." is used.
	MulticastDomains []names.FQDN

	// UnicastDial is the underlying dialer used to establish a connection to
	// the unicast DNS server. It defaults to net.Dialer.DialContext().
	UnicastDial func(ctx context.Context, net, addr string) (net.Conn, error)
}

Dialer provides a Dial() method for use with net.Resolver.Dial.

The native Go resolver does not support mDNS. This dialer returns a proxy connection that intercepts DNS queries that contain questions about mDNS names, and sends them via multicast instead of to the unicast DNS server.

func (*Dialer) Dial

func (d *Dialer) Dial(
	ctx context.Context,
	network, address string,
) (net.Conn, error)

Dial returns a net.Conn that acts as a proxy to either a conventional unicast DNS server, or multicast servers on the local network(s).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL