@helia/routers 2.1.0 → 2.2.0
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 +14 -14
- package/dist/src/delegated-http-routing.d.ts.map +1 -1
- package/dist/src/delegated-http-routing.js +3 -0
- package/dist/src/delegated-http-routing.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/libp2p-routing.d.ts.map +1 -1
- package/dist/src/libp2p-routing.js +3 -0
- package/dist/src/libp2p-routing.js.map +1 -1
- package/dist/src/utils/delegated-http-routing-defaults.browser.js +1 -1
- package/dist/src/utils/delegated-http-routing-defaults.browser.js.map +1 -1
- package/dist/src/utils/delegated-http-routing-defaults.js +1 -1
- package/dist/src/utils/delegated-http-routing-defaults.js.map +1 -1
- package/dist/typedoc-urls.json +1 -0
- package/package.json +3 -3
- package/src/delegated-http-routing.ts +10 -6
- package/src/index.ts +1 -0
- package/src/libp2p-routing.ts +4 -0
- package/src/utils/delegated-http-routing-defaults.browser.ts +1 -1
- package/src/utils/delegated-http-routing-defaults.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegated-http-routing.d.ts","sourceRoot":"","sources":["../../src/delegated-http-routing.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAmC,mCAAmC,EAAE,MAAM,6CAA6C,CAAA;AACvI,OAAO,KAAK,EAAY,OAAO,EAAkB,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"delegated-http-routing.d.ts","sourceRoot":"","sources":["../../src/delegated-http-routing.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAmC,mCAAmC,EAAE,MAAM,6CAA6C,CAAA;AACvI,OAAO,KAAK,EAAY,OAAO,EAAkB,MAAM,kBAAkB,CAAA;AAwFzE;;GAEG;AACH,wBAAgB,oBAAoB,CAAE,GAAG,EAAE,MAAM,GAAG,GAAG,EAAE,IAAI,CAAC,EAAE,mCAAmC,GAAG,OAAO,CAG5G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegated-http-routing.js","sourceRoot":"","sources":["../../src/delegated-http-routing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qCAAqC,EAAE,MAAM,6CAA6C,CAAA;AACnG,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAA;AAC1F,OAAO,KAAK,MAAM,UAAU,CAAA;AAC5B,OAAO,GAAG,MAAM,QAAQ,CAAA;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAA;AAMzF,MAAM,WAAW,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAA;AAElD,SAAS,SAAS,CAAE,GAAe;IACjC,OAAO,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC,CAAA;AAC/E,CAAC;AAED,MAAM,mBAAmB;IACN,MAAM,CAAiC;IAExD,YAAa,GAAQ,EAAE,OAA4C,EAAE;QACnE,IAAI,CAAC,MAAM,GAAG,qCAAqC,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAChE,CAAC;IAED,KAAK,CAAC,OAAO,CAAE,GAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"delegated-http-routing.js","sourceRoot":"","sources":["../../src/delegated-http-routing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qCAAqC,EAAE,MAAM,6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AK,CAAC,QAAQ,CAAE,MAAc,EAAE,OAAwB;QACtD,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;QAE/D,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;YACjB,OAAO;gBACL,EAAE,EAAE,IAAI,CAAC,EAAE;gBACX,UAAU,EAAE,IAAI,CAAC,KAAK,IAAI,EAAE;aAC7B,CAAA;QACH,CAAC;QAED,MAAM,IAAI,aAAa,CAAC,WAAW,CAAC,CAAA;IACtC,CAAC;IAED,KAAK,CAAC,CAAE,eAAe,CAAE,GAAe,EAAE,OAAwB;QAChE,OAAO;IACT,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAE,GAAiB,EAAE,IAA0C;IACjG,MAAM,MAAM,GAAG,IAAI,IAAI,4BAA4B,EAAE,CAAA;IACrD,OAAO,IAAI,mBAAmB,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAA;AACtD,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Abstraction layer over different content and peer routing mechanisms.
|
|
5
5
|
*/
|
|
6
6
|
export { delegatedHTTPRouting } from './delegated-http-routing.js';
|
|
7
|
+
export { delegatedHTTPRoutingDefaults } from './utils/delegated-http-routing-defaults.js';
|
|
7
8
|
export { httpGatewayRouting } from './http-gateway-routing.js';
|
|
8
9
|
export type { HTTPGatwayRouterInit } from './http-gateway-routing.js';
|
|
9
10
|
export { libp2pRouting } from './libp2p-routing.js';
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9D,YAAY,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAA;AACzF,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9D,YAAY,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA"}
|
package/dist/src/index.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Abstraction layer over different content and peer routing mechanisms.
|
|
5
5
|
*/
|
|
6
6
|
export { delegatedHTTPRouting } from './delegated-http-routing.js';
|
|
7
|
+
export { delegatedHTTPRoutingDefaults } from './utils/delegated-http-routing-defaults.js';
|
|
7
8
|
export { httpGatewayRouting } from './http-gateway-routing.js';
|
|
8
9
|
export { libp2pRouting } from './libp2p-routing.js';
|
|
9
10
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAA;AACzF,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libp2p-routing.d.ts","sourceRoot":"","sources":["../../src/libp2p-routing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,OAAO,EAAkB,MAAM,kBAAkB,CAAA;AACzE,OAAO,KAAK,EAAE,MAAM,EAAoB,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"libp2p-routing.d.ts","sourceRoot":"","sources":["../../src/libp2p-routing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,OAAO,EAAkB,MAAM,kBAAkB,CAAA;AACzE,OAAO,KAAK,EAAE,MAAM,EAAoB,MAAM,mBAAmB,CAAA;AAuCjE,wBAAgB,aAAa,CAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAEtD"}
|
|
@@ -6,6 +6,9 @@ class Libp2pRouter {
|
|
|
6
6
|
async provide(cid, options) {
|
|
7
7
|
await this.libp2p.contentRouting.provide(cid, options);
|
|
8
8
|
}
|
|
9
|
+
async cancelReprovide(key, options) {
|
|
10
|
+
await this.libp2p.contentRouting.cancelReprovide(key, options);
|
|
11
|
+
}
|
|
9
12
|
async *findProviders(cid, options) {
|
|
10
13
|
yield* this.libp2p.contentRouting.findProviders(cid, options);
|
|
11
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libp2p-routing.js","sourceRoot":"","sources":["../../src/libp2p-routing.ts"],"names":[],"mappings":"AAIA,MAAM,YAAY;IACC,MAAM,CAAQ;IAE/B,YAAa,MAAc;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED,KAAK,CAAC,OAAO,CAAE,GAAQ,EAAE,OAAw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7 +1,7 @@
|
|
|
1
1
|
export function delegatedHTTPRoutingDefaults() {
|
|
2
2
|
return {
|
|
3
3
|
filterProtocols: ['unknown', 'transport-bitswap', 'transport-ipfs-gateway-http'],
|
|
4
|
-
filterAddrs: ['https', 'webtransport', 'webrtc', 'webrtc-direct', 'wss']
|
|
4
|
+
filterAddrs: ['https', 'webtransport', 'webrtc', 'webrtc-direct', 'wss', 'tls']
|
|
5
5
|
};
|
|
6
6
|
}
|
|
7
7
|
//# sourceMappingURL=delegated-http-routing-defaults.browser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegated-http-routing-defaults.browser.js","sourceRoot":"","sources":["../../../src/utils/delegated-http-routing-defaults.browser.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,4BAA4B;IAC1C,OAAO;QACL,eAAe,EAAE,CAAC,SAAS,EAAE,mBAAmB,EAAE,6BAA6B,CAAC;QAChF,WAAW,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,eAAe,EAAE,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"delegated-http-routing-defaults.browser.js","sourceRoot":"","sources":["../../../src/utils/delegated-http-routing-defaults.browser.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,4BAA4B;IAC1C,OAAO;QACL,eAAe,EAAE,CAAC,SAAS,EAAE,mBAAmB,EAAE,6BAA6B,CAAC;QAChF,WAAW,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,CAAC;KAChF,CAAA;AACH,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export function delegatedHTTPRoutingDefaults() {
|
|
2
2
|
return {
|
|
3
3
|
filterProtocols: ['unknown', 'transport-bitswap', 'transport-ipfs-gateway-http'],
|
|
4
|
-
filterAddrs: ['https', 'tcp', 'webrtc', 'webrtc-direct', 'wss']
|
|
4
|
+
filterAddrs: ['https', 'tcp', 'webrtc', 'webrtc-direct', 'wss', 'tls']
|
|
5
5
|
};
|
|
6
6
|
}
|
|
7
7
|
//# sourceMappingURL=delegated-http-routing-defaults.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegated-http-routing-defaults.js","sourceRoot":"","sources":["../../../src/utils/delegated-http-routing-defaults.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,4BAA4B;IAC1C,OAAO;QACL,eAAe,EAAE,CAAC,SAAS,EAAE,mBAAmB,EAAE,6BAA6B,CAAC;QAChF,WAAW,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"delegated-http-routing-defaults.js","sourceRoot":"","sources":["../../../src/utils/delegated-http-routing-defaults.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,4BAA4B;IAC1C,OAAO;QACL,eAAe,EAAE,CAAC,SAAS,EAAE,mBAAmB,EAAE,6BAA6B,CAAC;QAChF,WAAW,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,CAAC;KACvE,CAAA;AACH,CAAC"}
|
package/dist/typedoc-urls.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"HTTPGatwayRouterInit": "https://ipfs.github.io/helia/interfaces/_helia_routers.HTTPGatwayRouterInit.html",
|
|
3
3
|
"delegatedHTTPRouting": "https://ipfs.github.io/helia/functions/_helia_routers.delegatedHTTPRouting.html",
|
|
4
|
+
"delegatedHTTPRoutingDefaults": "https://ipfs.github.io/helia/functions/_helia_routers.delegatedHTTPRoutingDefaults.html",
|
|
4
5
|
"httpGatewayRouting": "https://ipfs.github.io/helia/functions/_helia_routers.httpGatewayRouting.html",
|
|
5
6
|
"libp2pRouting": "https://ipfs.github.io/helia/functions/_helia_routers.libp2pRouting.html"
|
|
6
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@helia/routers",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Routers for Helia",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/ipfs/helia/tree/main/packages/routers#readme",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@helia/delegated-routing-v1-http-api-client": "^4.1.0",
|
|
58
|
-
"@helia/interface": "^5.
|
|
58
|
+
"@helia/interface": "^5.1.0",
|
|
59
59
|
"@libp2p/peer-id": "^5.0.0",
|
|
60
60
|
"@libp2p/interface": "^2.0.0",
|
|
61
61
|
"@multiformats/uri-to-multiaddr": "^8.0.0",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@libp2p/crypto": "^5.0.0",
|
|
70
|
-
"aegir": "^
|
|
70
|
+
"aegir": "^45.0.1",
|
|
71
71
|
"it-all": "^3.0.4",
|
|
72
72
|
"it-drain": "^3.0.5",
|
|
73
73
|
"sinon-ts": "^2.0.0"
|
|
@@ -25,11 +25,15 @@ class DelegatedHTTPRouter implements Routing {
|
|
|
25
25
|
this.client = createDelegatedRoutingV1HttpApiClient(url, init)
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
async provide (cid: CID, options?: RoutingOptions
|
|
28
|
+
async provide (cid: CID, options?: RoutingOptions): Promise<void> {
|
|
29
29
|
// noop
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
async
|
|
32
|
+
async cancelReprovide (cid?: CID, options?: RoutingOptions): Promise<void> {
|
|
33
|
+
// noop
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
async * findProviders (cid: CID<unknown, number, number, Version>, options?: RoutingOptions): AsyncIterable<Provider> {
|
|
33
37
|
yield * map(this.client.getProviders(cid, options), (record) => {
|
|
34
38
|
return {
|
|
35
39
|
id: record.ID,
|
|
@@ -39,7 +43,7 @@ class DelegatedHTTPRouter implements Routing {
|
|
|
39
43
|
})
|
|
40
44
|
}
|
|
41
45
|
|
|
42
|
-
async put (key: Uint8Array, value: Uint8Array, options?: RoutingOptions
|
|
46
|
+
async put (key: Uint8Array, value: Uint8Array, options?: RoutingOptions): Promise<void> {
|
|
43
47
|
if (!isIPNSKey(key)) {
|
|
44
48
|
return
|
|
45
49
|
}
|
|
@@ -51,7 +55,7 @@ class DelegatedHTTPRouter implements Routing {
|
|
|
51
55
|
await this.client.putIPNS(cid, record, options)
|
|
52
56
|
}
|
|
53
57
|
|
|
54
|
-
async get (key: Uint8Array, options?: RoutingOptions
|
|
58
|
+
async get (key: Uint8Array, options?: RoutingOptions): Promise<Uint8Array> {
|
|
55
59
|
if (!isIPNSKey(key)) {
|
|
56
60
|
throw new NotFoundError('Not found')
|
|
57
61
|
}
|
|
@@ -74,7 +78,7 @@ class DelegatedHTTPRouter implements Routing {
|
|
|
74
78
|
}
|
|
75
79
|
}
|
|
76
80
|
|
|
77
|
-
async findPeer (peerId: PeerId, options?: RoutingOptions
|
|
81
|
+
async findPeer (peerId: PeerId, options?: RoutingOptions): Promise<PeerInfo> {
|
|
78
82
|
const peer = await first(this.client.getPeers(peerId, options))
|
|
79
83
|
|
|
80
84
|
if (peer != null) {
|
|
@@ -87,7 +91,7 @@ class DelegatedHTTPRouter implements Routing {
|
|
|
87
91
|
throw new NotFoundError('Not found')
|
|
88
92
|
}
|
|
89
93
|
|
|
90
|
-
async * getClosestPeers (key: Uint8Array, options?: RoutingOptions
|
|
94
|
+
async * getClosestPeers (key: Uint8Array, options?: RoutingOptions): AsyncIterable<PeerInfo> {
|
|
91
95
|
// noop
|
|
92
96
|
}
|
|
93
97
|
}
|
package/src/index.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Abstraction layer over different content and peer routing mechanisms.
|
|
5
5
|
*/
|
|
6
6
|
export { delegatedHTTPRouting } from './delegated-http-routing.js'
|
|
7
|
+
export { delegatedHTTPRoutingDefaults } from './utils/delegated-http-routing-defaults.js'
|
|
7
8
|
export { httpGatewayRouting } from './http-gateway-routing.js'
|
|
8
9
|
export type { HTTPGatwayRouterInit } from './http-gateway-routing.js'
|
|
9
10
|
export { libp2pRouting } from './libp2p-routing.js'
|
package/src/libp2p-routing.ts
CHANGED
|
@@ -13,6 +13,10 @@ class Libp2pRouter implements Routing {
|
|
|
13
13
|
await this.libp2p.contentRouting.provide(cid, options)
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
async cancelReprovide (key: CID, options?: RoutingOptions): Promise<void> {
|
|
17
|
+
await this.libp2p.contentRouting.cancelReprovide(key, options)
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
async * findProviders (cid: CID, options?: RoutingOptions): AsyncIterable<Provider> {
|
|
17
21
|
yield * this.libp2p.contentRouting.findProviders(cid, options)
|
|
18
22
|
}
|
|
@@ -3,6 +3,6 @@ import type { DelegatedRoutingV1HttpApiClientInit } from '@helia/delegated-routi
|
|
|
3
3
|
export function delegatedHTTPRoutingDefaults (): DelegatedRoutingV1HttpApiClientInit {
|
|
4
4
|
return {
|
|
5
5
|
filterProtocols: ['unknown', 'transport-bitswap', 'transport-ipfs-gateway-http'],
|
|
6
|
-
filterAddrs: ['https', 'webtransport', 'webrtc', 'webrtc-direct', 'wss']
|
|
6
|
+
filterAddrs: ['https', 'webtransport', 'webrtc', 'webrtc-direct', 'wss', 'tls']
|
|
7
7
|
}
|
|
8
8
|
}
|
|
@@ -3,6 +3,6 @@ import type { DelegatedRoutingV1HttpApiClientInit } from '@helia/delegated-routi
|
|
|
3
3
|
export function delegatedHTTPRoutingDefaults (): DelegatedRoutingV1HttpApiClientInit {
|
|
4
4
|
return {
|
|
5
5
|
filterProtocols: ['unknown', 'transport-bitswap', 'transport-ipfs-gateway-http'],
|
|
6
|
-
filterAddrs: ['https', 'tcp', 'webrtc', 'webrtc-direct', 'wss']
|
|
6
|
+
filterAddrs: ['https', 'tcp', 'webrtc', 'webrtc-direct', 'wss', 'tls']
|
|
7
7
|
}
|
|
8
8
|
}
|