Skip to content

Commit cb6a3f6

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/react-dom-19.0.0
2 parents 08df569 + 88897fc commit cb6a3f6

File tree

5 files changed

+35
-6
lines changed

5 files changed

+35
-6
lines changed

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

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Let's configure the relevant modules:
4646
```js
4747
import { noise } from '@chainsafe/libp2p-noise'
4848
import { yamux } from '@chainsafe/libp2p-yamux'
49-
import { autoTLS } from '@libp2p/auto-tls'
49+
import { autoTLS } from '@ipshipyard/libp2p-auto-tls'
5050
import { loadOrCreateSelfKey } from '@libp2p/config'
5151
import { identify, identifyPush } from '@libp2p/identify'
5252
import { keychain } from '@libp2p/keychain'
@@ -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
@@ -218,7 +247,7 @@ module to connect to an initial set of peers that will let us start to fill our
218247
routing table and perform queries:
219248

220249
```diff
221-
import { autoTLS } from '@libp2p/auto-tls'
250+
import { autoTLS } from '@ipshipyard/libp2p-auto-tls'
222251
+ import { bootstrap } from '@libp2p/bootstrap'
223252
import { loadOrCreateSelfKey } from '@libp2p/config'
224253
import { identify, identifyPush } from '@libp2p/identify'

examples/js-libp2p-example-auto-tls/auto-confirm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import { noise } from '@chainsafe/libp2p-noise'
66
import { yamux } from '@chainsafe/libp2p-yamux'
7-
import { autoTLS } from '@libp2p/auto-tls'
7+
import { autoTLS } from '@ipshipyard/libp2p-auto-tls'
88
import { loadOrCreateSelfKey } from '@libp2p/config'
99
import { identify, identifyPush } from '@libp2p/identify'
1010
import { keychain } from '@libp2p/keychain'

examples/js-libp2p-example-auto-tls/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"dependencies": {
1919
"@chainsafe/libp2p-noise": "^16.0.0",
2020
"@chainsafe/libp2p-yamux": "^7.0.0",
21-
"@libp2p/auto-tls": "^1.0.0",
21+
"@ipshipyard/libp2p-auto-tls": "^1.0.0",
2222
"@libp2p/autonat": "^2.0.13",
2323
"@libp2p/bootstrap": "^11.0.14",
2424
"@libp2p/config": "^1.0.0",

examples/js-libp2p-example-auto-tls/trust-free.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import { noise } from '@chainsafe/libp2p-noise'
66
import { yamux } from '@chainsafe/libp2p-yamux'
7-
import { autoTLS } from '@libp2p/auto-tls'
7+
import { autoTLS } from '@ipshipyard/libp2p-auto-tls'
88
import { autoNAT } from '@libp2p/autonat'
99
import { bootstrap } from '@libp2p/bootstrap'
1010
import { loadOrCreateSelfKey } from '@libp2p/config'

examples/js-libp2p-example-chat/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@libp2p/websockets": "^9.0.0",
2424
"@multiformats/multiaddr": "^12.3.1",
2525
"@nodeutils/defaults-deep": "^1.1.0",
26-
"it-length-prefixed": "^9.0.1",
26+
"it-length-prefixed": "^10.0.1",
2727
"it-map": "^3.0.3",
2828
"it-pipe": "^3.0.1",
2929
"libp2p": "^2.0.0",

0 commit comments

Comments
 (0)