OptionaladdrsListening addresses in "host:port" format (e.g. "0.0.0.0:4001").
IPv6 addresses must use bracket notation: "[::]:4001".
Defaults to defaultRelayListenAddrs.
Called when agent-info bytes have been received from a peer.
OptionalenableOpt into the libp2p ping protocol (/ipfs/ping/1.0.0). Defaults to
false.
Ping is a transport-level liveness/RTT probe: a dialer sends a payload, the relay echoes it, and the dialer measures round-trip time. Useful for external monitoring of relay liveness, latency measurement before selecting a bootstrap relay, and keeping NAT/firewall mappings warm.
Ping runs as a libp2p service handler, independent of the
/peerkit/access/v1 gate: it is not blocked for peers that have not
completed the network-access handshake, so external monitors can health-
check the relay without holding NetworkAccessBytes.
OptionalidOptional human-readable identifier attached to log records.
OptionalnetworkNetwork access bytes sent in handshake responses (and outbound handshakes for nodes).
Defaults to new Uint8Array([0]) — an empty array breaks the
counter-handshake because .send() would be a no-op.
Handler invoked for every incoming access handshake. Returns true to grant access, false to deny. Denials are sticky for the session.
Called when an inbound peer completes the access handshake. Fire-and-forget.
OptionalpeerCalled when a peer disconnects. Fire-and-forget.
OptionalpublicPublic IP to announce when the relay is behind NAT.
The transport computes /ip4/<ip>/tcp/<port>/ws (or /ip6/…) for each
listen address and configures libp2p to advertise it. Peers dial the
public address; the relay still binds locally to addrs.
Node-specific options accepted by createRelay, on top of the platform-agnostic RelayOptions.