libp2p 1.2.0 → 1.2.1-03ff9fd82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.min.js +13 -24
- package/dist/src/config/connection-gater.browser.js +2 -2
- package/dist/src/config/connection-gater.browser.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.d.ts.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/package.json +18 -19
- package/src/config/connection-gater.browser.ts +2 -2
- package/src/version.ts +1 -1
- package/dist/typedoc-urls.json +0 -14
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { isPrivateIp } from '@libp2p/utils/private-ip';
|
|
2
2
|
/**
|
|
3
3
|
* Returns a connection gater that disallows dialling private addresses by
|
|
4
4
|
* default. Browsers are severely limited in their resource usage so don't
|
|
@@ -10,7 +10,7 @@ export function connectionGater(gater = {}) {
|
|
|
10
10
|
denyDialMultiaddr: async (multiaddr) => {
|
|
11
11
|
const tuples = multiaddr.stringTuples();
|
|
12
12
|
if (tuples[0][0] === 4 || tuples[0][0] === 41) {
|
|
13
|
-
return Boolean(
|
|
13
|
+
return Boolean(isPrivateIp(`${tuples[0][1]}`));
|
|
14
14
|
}
|
|
15
15
|
return false;
|
|
16
16
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection-gater.browser.js","sourceRoot":"","sources":["../../../src/config/connection-gater.browser.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"connection-gater.browser.js","sourceRoot":"","sources":["../../../src/config/connection-gater.browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAItD;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAE,QAAyB,EAAE;IAC1D,OAAO;QACL,YAAY,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAC/B,iBAAiB,EAAE,KAAK,EAAE,SAAoB,EAAE,EAAE;YAChD,MAAM,MAAM,GAAG,SAAS,CAAC,YAAY,EAAE,CAAA;YAEvC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC;gBAC9C,OAAO,OAAO,CAAC,WAAW,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;YAChD,CAAC;YAED,OAAO,KAAK,CAAA;QACd,CAAC;QACD,qBAAqB,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACxC,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACzC,8BAA8B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACjD,+BAA+B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAClD,6BAA6B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAChD,8BAA8B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACjD,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,IAAI;QACxC,GAAG,KAAK;KACT,CAAA;AACH,CAAC"}
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,oBAAoB,CAAA;AACxC,eAAO,MAAM,IAAI,WAAW,CAAA"}
|
package/dist/src/version.js
CHANGED
package/dist/src/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,iBAAiB,CAAA;AACxC,MAAM,CAAC,MAAM,IAAI,GAAG,QAAQ,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "libp2p",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1-03ff9fd82",
|
|
4
4
|
"description": "JavaScript implementation of libp2p, a modular peer to peer network stack",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/libp2p#readme",
|
|
@@ -84,16 +84,16 @@
|
|
|
84
84
|
"test:webkit": "aegir test -t browser -f \"./dist/test/**/*.spec.js\" -- --browser webkit"
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"@libp2p/crypto": "
|
|
88
|
-
"@libp2p/interface": "
|
|
89
|
-
"@libp2p/interface-internal": "
|
|
90
|
-
"@libp2p/logger": "
|
|
91
|
-
"@libp2p/multistream-select": "
|
|
92
|
-
"@libp2p/peer-collections": "
|
|
93
|
-
"@libp2p/peer-id": "
|
|
94
|
-
"@libp2p/peer-id-factory": "
|
|
95
|
-
"@libp2p/peer-store": "
|
|
96
|
-
"@libp2p/utils": "
|
|
87
|
+
"@libp2p/crypto": "4.0.1-03ff9fd82",
|
|
88
|
+
"@libp2p/interface": "1.1.2-03ff9fd82",
|
|
89
|
+
"@libp2p/interface-internal": "1.0.7-03ff9fd82",
|
|
90
|
+
"@libp2p/logger": "4.0.5-03ff9fd82",
|
|
91
|
+
"@libp2p/multistream-select": "5.1.2-03ff9fd82",
|
|
92
|
+
"@libp2p/peer-collections": "5.1.5-03ff9fd82",
|
|
93
|
+
"@libp2p/peer-id": "4.0.5-03ff9fd82",
|
|
94
|
+
"@libp2p/peer-id-factory": "4.0.5-03ff9fd82",
|
|
95
|
+
"@libp2p/peer-store": "10.0.8-03ff9fd82",
|
|
96
|
+
"@libp2p/utils": "5.2.3-03ff9fd82",
|
|
97
97
|
"@multiformats/multiaddr": "^12.1.10",
|
|
98
98
|
"any-signal": "^4.1.1",
|
|
99
99
|
"datastore-core": "^9.0.1",
|
|
@@ -102,18 +102,17 @@
|
|
|
102
102
|
"it-parallel": "^3.0.6",
|
|
103
103
|
"merge-options": "^3.0.4",
|
|
104
104
|
"multiformats": "^13.0.0",
|
|
105
|
-
"private-ip": "^3.0.1",
|
|
106
105
|
"uint8arrays": "^5.0.0"
|
|
107
106
|
},
|
|
108
107
|
"devDependencies": {
|
|
109
108
|
"@chainsafe/libp2p-yamux": "^6.0.1",
|
|
110
|
-
"@libp2p/circuit-relay-v2": "
|
|
111
|
-
"@libp2p/identify": "
|
|
112
|
-
"@libp2p/interface-compliance-tests": "
|
|
113
|
-
"@libp2p/mplex": "
|
|
114
|
-
"@libp2p/plaintext": "
|
|
115
|
-
"@libp2p/tcp": "
|
|
116
|
-
"@libp2p/websockets": "
|
|
109
|
+
"@libp2p/circuit-relay-v2": "1.0.13-03ff9fd82",
|
|
110
|
+
"@libp2p/identify": "1.0.12-03ff9fd82",
|
|
111
|
+
"@libp2p/interface-compliance-tests": "5.2.0-03ff9fd82",
|
|
112
|
+
"@libp2p/mplex": "10.0.13-03ff9fd82",
|
|
113
|
+
"@libp2p/plaintext": "1.0.13-03ff9fd82",
|
|
114
|
+
"@libp2p/tcp": "9.0.13-03ff9fd82",
|
|
115
|
+
"@libp2p/websockets": "8.0.13-03ff9fd82",
|
|
117
116
|
"@multiformats/mafmt": "^12.1.6",
|
|
118
117
|
"@multiformats/multiaddr-matcher": "^1.1.0",
|
|
119
118
|
"aegir": "^42.0.0",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { isPrivateIp } from '@libp2p/utils/private-ip'
|
|
2
2
|
import type { ConnectionGater } from '@libp2p/interface'
|
|
3
3
|
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
4
4
|
|
|
@@ -14,7 +14,7 @@ export function connectionGater (gater: ConnectionGater = {}): ConnectionGater {
|
|
|
14
14
|
const tuples = multiaddr.stringTuples()
|
|
15
15
|
|
|
16
16
|
if (tuples[0][0] === 4 || tuples[0][0] === 41) {
|
|
17
|
-
return Boolean(
|
|
17
|
+
return Boolean(isPrivateIp(`${tuples[0][1]}`))
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
return false
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '1.2.
|
|
1
|
+
export const version = '1.2.1-03ff9fd82'
|
|
2
2
|
export const name = 'libp2p'
|
package/dist/typedoc-urls.json
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"Libp2pInit": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.Libp2pInit.html",
|
|
3
|
-
".:Libp2pInit": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.Libp2pInit.html",
|
|
4
|
-
"Libp2pOptions": "https://libp2p.github.io/js-libp2p/types/libp2p.index.Libp2pOptions.html",
|
|
5
|
-
".:Libp2pOptions": "https://libp2p.github.io/js-libp2p/types/libp2p.index.Libp2pOptions.html",
|
|
6
|
-
"ServiceFactoryMap": "https://libp2p.github.io/js-libp2p/types/libp2p.index.ServiceFactoryMap.html",
|
|
7
|
-
".:ServiceFactoryMap": "https://libp2p.github.io/js-libp2p/types/libp2p.index.ServiceFactoryMap.html",
|
|
8
|
-
"createLibp2p": "https://libp2p.github.io/js-libp2p/functions/libp2p.index.createLibp2p.html",
|
|
9
|
-
".:createLibp2p": "https://libp2p.github.io/js-libp2p/functions/libp2p.index.createLibp2p.html",
|
|
10
|
-
"name": "https://libp2p.github.io/js-libp2p/variables/libp2p.version.name.html",
|
|
11
|
-
"./version:name": "https://libp2p.github.io/js-libp2p/variables/libp2p.version.name.html",
|
|
12
|
-
"version": "https://libp2p.github.io/js-libp2p/variables/libp2p.version.version.html",
|
|
13
|
-
"./version:version": "https://libp2p.github.io/js-libp2p/variables/libp2p.version.version.html"
|
|
14
|
-
}
|