NetworkConfig constructor
- List<
String> listenAddresses = defaultListenAddresses, - List<
String> bootstrapPeers = defaultBootstrapPeers, - int maxConnections = 50,
- Duration connectionTimeout = const Duration(seconds: 30),
- bool enableNatTraversal = false,
- bool enableMDNS = true,
- bool enableWebTransport = true,
- bool enableWebRtc = true,
- bool enableQuic = false,
- int quicListenPort = 4002,
- int quicMaxStreams = 100,
- bool preferQuic = false,
- CircuitRelayConfig circuitRelay = const CircuitRelayConfig(),
- List<
String> stunServers = const [], - List<
TurnServer> turnServers = const [], - String? nodeId,
- String? delegatedRoutingEndpoint,
Creates a network configuration with the given options.
Implementation
NetworkConfig({
this.listenAddresses = defaultListenAddresses,
this.bootstrapPeers = defaultBootstrapPeers,
this.maxConnections = 50,
this.connectionTimeout = const Duration(seconds: 30),
this.enableNatTraversal = false,
this.enableMDNS = true,
this.enableWebTransport = true,
this.enableWebRtc = true,
this.enableQuic = false,
this.quicListenPort = 4002,
this.quicMaxStreams = 100,
this.preferQuic = false,
this.circuitRelay = const CircuitRelayConfig(),
this.stunServers = const [],
this.turnServers = const [],
String? nodeId,
this.delegatedRoutingEndpoint,
}) : nodeId = nodeId ?? _generateDefaultNodeId();