File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -163,10 +163,11 @@ func NewClient(config Config) (P2PClient, error) {
163163 fmt .Sprintf ("/ip4/0.0.0.0/tcp/%d" , config .Port ), // Listen on all interfaces
164164 fmt .Sprintf ("/ip6/::/tcp/%d" , config .Port ),
165165 ),
166- libp2p .EnableNATService (),
167- libp2p .EnableHolePunching (),
168- libp2p .EnableRelay (),
169- libp2p .EnableAutoRelayWithStaticRelays ([]peer.AddrInfo {}), // Enable auto relay discovery via DHT
166+ libp2p .NATPortMap (), // Try UPnP/NAT-PMP for automatic port forwarding
167+ libp2p .EnableNATService (), // AutoNAT to detect if we're reachable
168+ libp2p .EnableHolePunching (), // DCUtR protocol for NAT hole punching
169+ libp2p .EnableRelay (), // Act as relay for others
170+ libp2p .EnableAutoRelayWithStaticRelays ([]peer.AddrInfo {}), // Use relays if we're unreachable
170171 libp2p .AddrsFactory (addressFactory ),
171172 libp2p .ConnectionGater (ipFilter ),
172173 )
You can’t perform that action at this time.
0 commit comments