Documentation ¶
Index ¶
- type DialContextFn
- type Network
- func (n *Network) Close() error
- func (n *Network) Dial(network, address string) (net.Conn, error)
- func (n *Network) DialContext(ctx context.Context, network, address string) (net.Conn, error)
- func (n *Network) GetPeerEndpoint(publicKey transport.NoisePublicKey) (netip.AddrPort, error)
- func (n *Network) Listen(network, address string) (net.Listener, error)
- func (n *Network) ListenPacket(network, address string) (net.PacketConn, error)
- func (n *Network) LookupHost(host string) ([]string, error)
- func (n *Network) LookupPeerByAddress(addr netip.Addr) (transport.NoisePublicKey, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DialContextFn ¶ added in v0.5.0
type Network ¶ added in v0.8.0
type Network struct {
// contains filtered or unexported fields
}
Network is a userspace WireGuard peer that exposes Dial() and Listen() methods compatible with the net package.
func NewNetwork ¶ added in v0.8.0
func (*Network) Close ¶ added in v0.8.0
Close closes the network and releases any resources associated with it.
func (*Network) DialContext ¶ added in v0.8.0
DialContext creates a network connection with a context.
func (*Network) GetPeerEndpoint ¶ added in v0.8.0
GetPeerEndpoint returns the public address/endpoint of a peer (if known).
func (*Network) Listen ¶ added in v0.8.0
Listen creates a network listener (only TCP is currently supported).
func (*Network) ListenPacket ¶ added in v0.8.0
func (n *Network) ListenPacket(network, address string) (net.PacketConn, error)
ListenPacket creates a network packet listener (only UDP is currently supported). Caveat: The SetDeadline, SetReadDeadline, or SetWriteDeadline f8unctions on the returned PacketConn may not work as expected (due to limitations in the gVisor network stack).
func (*Network) LookupHost ¶ added in v0.9.0
LookupHost resolves host names (encoded public keys) to IP addresses.
func (*Network) LookupPeerByAddress ¶ added in v0.8.1
LookupPeerByAddress returns the public key of a peer by its address.
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
conn
Package conn implements WireGuard's network connections.
|
Package conn implements WireGuard's network connections. |
replay
Package replay implements an efficient anti-replay algorithm as specified in RFC 6479.
|
Package replay implements an efficient anti-replay algorithm as specified in RFC 6479. |