Skip to content

Commit 40a439f

Browse files
authored
docs: add section on dealing with flaky routers (#200)
Show how to override the location of the router device description to handle flaky routers that don't always respond to SSDP M-SEARCH messages.
1 parent b4c7c91 commit 40a439f

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

examples/js-libp2p-example-auto-tls/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,35 @@ automatically configure port forwarding for IPv4 and IPv6 networks:
159159
identify: identify(),
160160
```
161161

162+
#### Dealing with unreliable routers
163+
164+
By default `@libp2p/upnp-nat` will use [SSDP](https://en.wikipedia.org/wiki/Simple_Service_Discovery_Protocol)
165+
to locate your router on the network in order to use it to map ports and
166+
discover it's externally routable address.
167+
168+
Some ISP-provided routers are underpowered and require rebooting before they
169+
will respond to `SSDP` search messages.
170+
171+
If you know the URL to the device descriptor of your [Internet Gateway Device](https://openconnectivity.org/developer/specifications/upnp-resources/upnp/internet-gateway-device-igd-v-2-0/)
172+
you can specify it manually and skip the search:
173+
174+
```diff
175+
services: {
176+
autoTLS: autoTLS(),
177+
+ upnp: uPnPNAT({
178+
+ gateways: [
179+
+ // manually specify URLs for device descriptor documents
180+
+ // these can be IPv4 and/or IPv6 (if supported by your network)
181+
+ 'http://192.168.1.1:8080/path/to/descriptor.xml'
182+
+ 'http://[xx:xx:xx:xx]:8080/path/to/descriptor.xml'
183+
+ ]
184+
+ }),
185+
identify: identify(),
186+
```
187+
188+
Note that UPnP will still need to be enabled to map external ports (IPv4) and/or
189+
to open pinholes in the firewall if necessary (IPv6).
190+
162191
### Confirming dialable addresses
163192

164193
Designing distributed systems typically involves trying to trust other system

0 commit comments

Comments
 (0)