package autonatv2

Import Path
	github.com/libp2p/go-libp2p/p2p/protocol/autonatv2 (on go.dev)

Dependency Relation
	imports 27 packages, and imported by 2 packages


Package-Level Type Names (total 6)
/* sort by: | */
AutoNAT implements the AutoNAT v2 client and server. Users can check reachability for their addresses using the CheckReachability method. The server provides amplification attack prevention and rate limiting. (*AutoNAT) Close() GetReachability makes a single dial request for checking reachability for requested addresses (*AutoNAT) Start(h host.Host) error func New(dialerHost host.Host, opts ...AutoNATOption) (*AutoNAT, error)
func WithMetricsTracer(m MetricsTracer) AutoNATOption func WithServerRateLimit(rpm, perPeerRPM, dialDataRPM int, maxConcurrentRequestsPerPeer int) AutoNATOption func New(dialerHost host.Host, opts ...AutoNATOption) (*AutoNAT, error)
DialDataRequired bool DialStatus pb.DialStatus DialedAddr ma.Multiaddr Error error ResponseStatus pb.DialResponse_ResponseStatus func MetricsTracer.CompletedRequest(EventDialRequestCompleted)
( MetricsTracer) ClientCompletedRequest([]Request, Result, error) ( MetricsTracer) CompletedRequest(EventDialRequestCompleted) func NewMetricsTracer(reg prometheus.Registerer) MetricsTracer func WithMetricsTracer(m MetricsTracer) AutoNATOption
Request is the request to verify reachability of a single address Addr is the multiaddr to verify SendDialData indicates whether to send dial data if the server requests it for Addr func (*AutoNAT).GetReachability(ctx context.Context, reqs []Request) (Result, error) func MetricsTracer.ClientCompletedRequest([]Request, Result, error)
Result is the result of the CheckReachability call Addr is the dialed address AllAddrsRefused is true when the server refused to dial all the addresses in the request. Idx is the index of the address that was dialed Reachability is the reachability for `Addr` func (*AutoNAT).GetReachability(ctx context.Context, reqs []Request) (Result, error) func MetricsTracer.ClientCompletedRequest([]Request, Result, error)
Package-Level Functions (total 4)
New returns a new AutoNAT instance. host and dialerHost should have the same dialing capabilities. In case the host doesn't support a transport, dial back requests for address for that transport will be ignored.
func WithServerRateLimit(rpm, perPeerRPM, dialDataRPM int, maxConcurrentRequestsPerPeer int) AutoNATOption
Package-Level Variables (total 2)
ErrNoPeers is returned when the client knows no autonatv2 servers.
ErrPrivateAddrs is returned when the request has private IP addresses.
Package-Level Constants (total 3)
const DialBackProtocol = "/libp2p/autonat/2/dial-back"
const DialProtocol = "/libp2p/autonat/2/dial-request"
const ServiceName = "libp2p.autonatv2"