@libp2p/websockets 9.2.0 → 9.2.1-9b1a3791d
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/src/filters.d.ts +12 -0
- package/dist/src/filters.d.ts.map +1 -1
- package/dist/src/filters.js +12 -0
- package/dist/src/filters.js.map +1 -1
- package/package.json +4 -4
- package/src/filters.ts +12 -0
- package/dist/typedoc-urls.json +0 -20
package/dist/src/filters.d.ts
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import type { Multiaddr } from '@multiformats/multiaddr';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Configure this globally by passing a `connectionGater` to `createLibp2p` with a `denyDialMultiaddr` method that returns `false`
|
|
4
|
+
*/
|
|
2
5
|
export declare function all(multiaddrs: Multiaddr[]): Multiaddr[];
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Configure this globally by passing a `connectionGater` to `createLibp2p`
|
|
8
|
+
*/
|
|
3
9
|
export declare function wss(multiaddrs: Multiaddr[]): Multiaddr[];
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Configure this globally by passing a `connectionGater` to `createLibp2p`
|
|
12
|
+
*/
|
|
4
13
|
export declare function dnsWss(multiaddrs: Multiaddr[]): Multiaddr[];
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Configure this globally by passing a `connectionGater` to `createLibp2p`
|
|
16
|
+
*/
|
|
5
17
|
export declare function dnsWsOrWss(multiaddrs: Multiaddr[]): Multiaddr[];
|
|
6
18
|
//# sourceMappingURL=filters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filters.d.ts","sourceRoot":"","sources":["../../src/filters.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,wBAAgB,GAAG,CAAE,UAAU,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,CAIzD;AAED,wBAAgB,GAAG,CAAE,UAAU,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,CAIzD;AAED,wBAAgB,MAAM,CAAE,UAAU,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,CAI5D;AAED,wBAAgB,UAAU,CAAE,UAAU,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,CAIhE"}
|
|
1
|
+
{"version":3,"file":"filters.d.ts","sourceRoot":"","sources":["../../src/filters.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD;;GAEG;AACH,wBAAgB,GAAG,CAAE,UAAU,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,CAIzD;AAED;;GAEG;AACH,wBAAgB,GAAG,CAAE,UAAU,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,CAIzD;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAE,UAAU,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,CAI5D;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAE,UAAU,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,CAIhE"}
|
package/dist/src/filters.js
CHANGED
|
@@ -1,19 +1,31 @@
|
|
|
1
1
|
import { WebSocketsSecure, WebSockets, DNS } from '@multiformats/multiaddr-matcher';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Configure this globally by passing a `connectionGater` to `createLibp2p` with a `denyDialMultiaddr` method that returns `false`
|
|
4
|
+
*/
|
|
2
5
|
export function all(multiaddrs) {
|
|
3
6
|
return multiaddrs.filter((ma) => {
|
|
4
7
|
return WebSocketsSecure.exactMatch(ma) || WebSockets.exactMatch(ma);
|
|
5
8
|
});
|
|
6
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Configure this globally by passing a `connectionGater` to `createLibp2p`
|
|
12
|
+
*/
|
|
7
13
|
export function wss(multiaddrs) {
|
|
8
14
|
return multiaddrs.filter((ma) => {
|
|
9
15
|
return WebSocketsSecure.exactMatch(ma);
|
|
10
16
|
});
|
|
11
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Configure this globally by passing a `connectionGater` to `createLibp2p`
|
|
20
|
+
*/
|
|
12
21
|
export function dnsWss(multiaddrs) {
|
|
13
22
|
return multiaddrs.filter((ma) => {
|
|
14
23
|
return DNS.matches(ma) && WebSocketsSecure.exactMatch(ma);
|
|
15
24
|
});
|
|
16
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated Configure this globally by passing a `connectionGater` to `createLibp2p`
|
|
28
|
+
*/
|
|
17
29
|
export function dnsWsOrWss(multiaddrs) {
|
|
18
30
|
return multiaddrs.filter((ma) => {
|
|
19
31
|
return DNS.matches(ma) && (WebSocketsSecure.exactMatch(ma) || WebSockets.exactMatch(ma));
|
package/dist/src/filters.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../src/filters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAA;AAGnF,MAAM,UAAU,GAAG,CAAE,UAAuB;IAC1C,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE;QAC9B,OAAO,gBAAgB,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC,CAAA;IACrE,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,UAAU,GAAG,CAAE,UAAuB;IAC1C,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE;QAC9B,OAAO,gBAAgB,CAAC,UAAU,CAAC,EAAE,CAAC,CAAA;IACxC,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,UAAU,MAAM,CAAE,UAAuB;IAC7C,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE;QAC9B,OAAO,GAAG,CAAC,OAAO,CAAC,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AAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAE,UAAuB;IACjD,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE;QAC9B,OAAO,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAA;IAC1F,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/websockets",
|
|
3
|
-
"version": "9.2.
|
|
3
|
+
"version": "9.2.1-9b1a3791d",
|
|
4
4
|
"description": "JavaScript implementation of the WebSockets module that libp2p uses and that implements the interface-transport spec",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/transport-websockets#readme",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
"test:electron-main": "aegir test -t electron-main -f ./dist/test/node.js --cov"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@libp2p/interface": "
|
|
78
|
-
"@libp2p/utils": "
|
|
77
|
+
"@libp2p/interface": "2.6.0-9b1a3791d",
|
|
78
|
+
"@libp2p/utils": "6.5.3-9b1a3791d",
|
|
79
79
|
"@multiformats/multiaddr": "^12.3.3",
|
|
80
80
|
"@multiformats/multiaddr-matcher": "^1.6.0",
|
|
81
81
|
"@multiformats/multiaddr-to-uri": "^11.0.0",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"ws": "^8.18.0"
|
|
89
89
|
},
|
|
90
90
|
"devDependencies": {
|
|
91
|
-
"@libp2p/logger": "
|
|
91
|
+
"@libp2p/logger": "5.1.9-9b1a3791d",
|
|
92
92
|
"aegir": "^45.0.5",
|
|
93
93
|
"is-loopback-addr": "^2.0.2",
|
|
94
94
|
"p-wait-for": "^5.0.2",
|
package/src/filters.ts
CHANGED
|
@@ -1,24 +1,36 @@
|
|
|
1
1
|
import { WebSocketsSecure, WebSockets, DNS } from '@multiformats/multiaddr-matcher'
|
|
2
2
|
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Configure this globally by passing a `connectionGater` to `createLibp2p` with a `denyDialMultiaddr` method that returns `false`
|
|
6
|
+
*/
|
|
4
7
|
export function all (multiaddrs: Multiaddr[]): Multiaddr[] {
|
|
5
8
|
return multiaddrs.filter((ma) => {
|
|
6
9
|
return WebSocketsSecure.exactMatch(ma) || WebSockets.exactMatch(ma)
|
|
7
10
|
})
|
|
8
11
|
}
|
|
9
12
|
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated Configure this globally by passing a `connectionGater` to `createLibp2p`
|
|
15
|
+
*/
|
|
10
16
|
export function wss (multiaddrs: Multiaddr[]): Multiaddr[] {
|
|
11
17
|
return multiaddrs.filter((ma) => {
|
|
12
18
|
return WebSocketsSecure.exactMatch(ma)
|
|
13
19
|
})
|
|
14
20
|
}
|
|
15
21
|
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Configure this globally by passing a `connectionGater` to `createLibp2p`
|
|
24
|
+
*/
|
|
16
25
|
export function dnsWss (multiaddrs: Multiaddr[]): Multiaddr[] {
|
|
17
26
|
return multiaddrs.filter((ma) => {
|
|
18
27
|
return DNS.matches(ma) && WebSocketsSecure.exactMatch(ma)
|
|
19
28
|
})
|
|
20
29
|
}
|
|
21
30
|
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated Configure this globally by passing a `connectionGater` to `createLibp2p`
|
|
33
|
+
*/
|
|
22
34
|
export function dnsWsOrWss (multiaddrs: Multiaddr[]): Multiaddr[] {
|
|
23
35
|
return multiaddrs.filter((ma) => {
|
|
24
36
|
return DNS.matches(ma) && (WebSocketsSecure.exactMatch(ma) || WebSockets.exactMatch(ma))
|
package/dist/typedoc-urls.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"all": "https://libp2p.github.io/js-libp2p/functions/_libp2p_websockets.filters.all.html",
|
|
3
|
-
"./filters:all": "https://libp2p.github.io/js-libp2p/functions/_libp2p_websockets.filters.all.html",
|
|
4
|
-
"dnsWsOrWss": "https://libp2p.github.io/js-libp2p/functions/_libp2p_websockets.filters.dnsWsOrWss.html",
|
|
5
|
-
"./filters:dnsWsOrWss": "https://libp2p.github.io/js-libp2p/functions/_libp2p_websockets.filters.dnsWsOrWss.html",
|
|
6
|
-
"dnsWss": "https://libp2p.github.io/js-libp2p/functions/_libp2p_websockets.filters.dnsWss.html",
|
|
7
|
-
"./filters:dnsWss": "https://libp2p.github.io/js-libp2p/functions/_libp2p_websockets.filters.dnsWss.html",
|
|
8
|
-
"wss": "https://libp2p.github.io/js-libp2p/functions/_libp2p_websockets.filters.wss.html",
|
|
9
|
-
"./filters:wss": "https://libp2p.github.io/js-libp2p/functions/_libp2p_websockets.filters.wss.html",
|
|
10
|
-
"WebSocketsComponents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_websockets.index.WebSocketsComponents.html",
|
|
11
|
-
".:WebSocketsComponents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_websockets.index.WebSocketsComponents.html",
|
|
12
|
-
"WebSocketsInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_websockets.index.WebSocketsInit.html",
|
|
13
|
-
".:WebSocketsInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_websockets.index.WebSocketsInit.html",
|
|
14
|
-
"WebSocketsMetrics": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_websockets.index.WebSocketsMetrics.html",
|
|
15
|
-
".:WebSocketsMetrics": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_websockets.index.WebSocketsMetrics.html",
|
|
16
|
-
"WebSocketsDialEvents": "https://libp2p.github.io/js-libp2p/types/_libp2p_websockets.index.WebSocketsDialEvents.html",
|
|
17
|
-
".:WebSocketsDialEvents": "https://libp2p.github.io/js-libp2p/types/_libp2p_websockets.index.WebSocketsDialEvents.html",
|
|
18
|
-
"webSockets": "https://libp2p.github.io/js-libp2p/functions/_libp2p_websockets.index.webSockets.html",
|
|
19
|
-
".:webSockets": "https://libp2p.github.io/js-libp2p/functions/_libp2p_websockets.index.webSockets.html"
|
|
20
|
-
}
|