NetworkConfig constructor

NetworkConfig({
  1. List<String> listenAddresses = defaultListenAddresses,
  2. List<String> bootstrapPeers = defaultBootstrapPeers,
  3. int maxConnections = 50,
  4. Duration connectionTimeout = const Duration(seconds: 30),
  5. bool enableNatTraversal = false,
  6. bool enableMDNS = true,
  7. bool enableWebTransport = true,
  8. bool enableWebRtc = true,
  9. bool enableQuic = false,
  10. int quicListenPort = 4002,
  11. int quicMaxStreams = 100,
  12. bool preferQuic = false,
  13. CircuitRelayConfig circuitRelay = const CircuitRelayConfig(),
  14. List<String> stunServers = const [],
  15. List<TurnServer> turnServers = const [],
  16. String? nodeId,
  17. 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();