p2p/protocol/holepunch/util library
Utility functions for the holepunch protocol.
Constants
- dialTimeout → const Duration
- Dial timeout for hole punching
- maxMsgSize → const int
- Maximum message size for the holepunch protocol
- maxRetries → const int
- Maximum number of retries for hole punching
- protocolId → const String
- Protocol ID for the holepunch protocol
- serviceName → const String
- Service name for the holepunch protocol
- streamTimeout → const Duration
- Stream timeout for the holepunch protocol
Functions
-
addrsFromBytes(
List bytes) → List< MultiAddr> - Converts a list of byte arrays to a list of multiaddrs
-
addrsToBytes(
List< MultiAddr> addrs) → List<Uint8List> - Converts a list of multiaddrs to a list of byte arrays
-
getDirectConnection(
Host host, PeerId peerId) → Conn? - Gets a direct (non-relay) connection to a peer if one exists
-
isRelayAddress(
MultiAddr addr) → bool - Checks if a multiaddr is a relay address
-
removeRelayAddrs(
List< MultiAddr> addrs) → List<MultiAddr> - Removes relay addresses from a list of multiaddrs