@libp2p/upnp-nat 4.0.15 → 4.0.17-8f7e9264e
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/index.js +1 -1
- package/dist/src/search-gateway-finder.d.ts +1 -1
- package/dist/src/search-gateway-finder.js +1 -1
- package/dist/src/static-gateway-finder.d.ts +1 -1
- package/dist/src/upnp-nat.browser.d.ts +1 -1
- package/dist/src/upnp-nat.d.ts +1 -1
- package/dist/src/upnp-nat.js +3 -3
- package/dist/src/upnp-port-mapper.js +2 -2
- package/package.json +9 -8
- package/src/index.ts +1 -1
- package/src/search-gateway-finder.ts +2 -2
- package/src/static-gateway-finder.ts +1 -1
- package/src/upnp-nat.browser.ts +1 -1
- package/src/upnp-nat.ts +4 -4
- package/src/upnp-port-mapper.ts +3 -3
- package/dist/typedoc-urls.json +0 -12
package/dist/src/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TypedEventEmitter } from 'main-event';
|
|
2
|
-
import type { GatewayFinder, GatewayFinderEvents } from './upnp-nat.
|
|
2
|
+
import type { GatewayFinder, GatewayFinderEvents } from './upnp-nat.ts';
|
|
3
3
|
import type { UPnPNAT } from '@achingbrain/nat-port-mapper';
|
|
4
4
|
import type { ComponentLogger } from '@libp2p/interface';
|
|
5
5
|
export interface SearchGatewayFinderComponents {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { start, stop } from '@libp2p/interface';
|
|
2
2
|
import { repeatingTask } from '@libp2p/utils';
|
|
3
3
|
import { TypedEventEmitter } from 'main-event';
|
|
4
|
-
import { DEFAULT_GATEWAY_SEARCH_INTERVAL, DEFAULT_GATEWAY_SEARCH_MESSAGE_INTERVAL, DEFAULT_GATEWAY_SEARCH_TIMEOUT, DEFAULT_INITIAL_GATEWAY_SEARCH_INTERVAL, DEFAULT_INITIAL_GATEWAY_SEARCH_MESSAGE_INTERVAL, DEFAULT_INITIAL_GATEWAY_SEARCH_TIMEOUT } from
|
|
4
|
+
import { DEFAULT_GATEWAY_SEARCH_INTERVAL, DEFAULT_GATEWAY_SEARCH_MESSAGE_INTERVAL, DEFAULT_GATEWAY_SEARCH_TIMEOUT, DEFAULT_INITIAL_GATEWAY_SEARCH_INTERVAL, DEFAULT_INITIAL_GATEWAY_SEARCH_MESSAGE_INTERVAL, DEFAULT_INITIAL_GATEWAY_SEARCH_TIMEOUT } from "./constants.js";
|
|
5
5
|
export class SearchGatewayFinder extends TypedEventEmitter {
|
|
6
6
|
log;
|
|
7
7
|
gateways;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TypedEventEmitter } from 'main-event';
|
|
2
|
-
import type { GatewayFinder, GatewayFinderEvents } from './upnp-nat.
|
|
2
|
+
import type { GatewayFinder, GatewayFinderEvents } from './upnp-nat.ts';
|
|
3
3
|
import type { UPnPNAT } from '@achingbrain/nat-port-mapper';
|
|
4
4
|
import type { ComponentLogger } from '@libp2p/interface';
|
|
5
5
|
export interface StaticGatewayFinderComponents {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { serviceCapabilities, serviceDependencies } from '@libp2p/interface';
|
|
2
|
-
import type { UPnPNATClient, UPnPNAT as UPnPNATInterface } from './index.
|
|
2
|
+
import type { UPnPNATClient, UPnPNAT as UPnPNATInterface } from './index.ts';
|
|
3
3
|
export declare class UPnPNAT implements UPnPNATInterface {
|
|
4
4
|
portMappingClient: UPnPNATClient;
|
|
5
5
|
constructor();
|
package/dist/src/upnp-nat.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { serviceCapabilities, serviceDependencies } from '@libp2p/interface';
|
|
2
|
-
import type { UPnPNATComponents, UPnPNATInit, UPnPNAT as UPnPNATInterface } from './index.
|
|
2
|
+
import type { UPnPNATComponents, UPnPNATInit, UPnPNAT as UPnPNATInterface } from './index.ts';
|
|
3
3
|
import type { Gateway, UPnPNAT as UPnPNATClient } from '@achingbrain/nat-port-mapper';
|
|
4
4
|
import type { Startable } from '@libp2p/interface';
|
|
5
5
|
import type { TypedEventTarget } from 'main-event';
|
package/dist/src/upnp-nat.js
CHANGED
|
@@ -2,9 +2,9 @@ import { upnpNat } from '@achingbrain/nat-port-mapper';
|
|
|
2
2
|
import { serviceCapabilities, serviceDependencies, start, stop } from '@libp2p/interface';
|
|
3
3
|
import { debounce } from '@libp2p/utils';
|
|
4
4
|
import { setMaxListeners } from 'main-event';
|
|
5
|
-
import { SearchGatewayFinder } from
|
|
6
|
-
import { StaticGatewayFinder } from
|
|
7
|
-
import { UPnPPortMapper } from
|
|
5
|
+
import { SearchGatewayFinder } from "./search-gateway-finder.js";
|
|
6
|
+
import { StaticGatewayFinder } from "./static-gateway-finder.js";
|
|
7
|
+
import { UPnPPortMapper } from "./upnp-port-mapper.js";
|
|
8
8
|
export class UPnPNAT {
|
|
9
9
|
log;
|
|
10
10
|
components;
|
|
@@ -3,8 +3,8 @@ import { InvalidParametersError, start, stop } from '@libp2p/interface';
|
|
|
3
3
|
import { getNetConfig, isLinkLocal, isLoopback, isPrivate, isPrivateIp } from '@libp2p/utils';
|
|
4
4
|
import { multiaddr } from '@multiformats/multiaddr';
|
|
5
5
|
import { QUIC_V1, TCP, WebSockets, WebSocketsSecure, WebTransport } from '@multiformats/multiaddr-matcher';
|
|
6
|
-
import { dynamicExternalAddress, staticExternalAddress } from
|
|
7
|
-
import { DoubleNATError } from
|
|
6
|
+
import { dynamicExternalAddress, staticExternalAddress } from "./check-external-address.js";
|
|
7
|
+
import { DoubleNATError } from "./errors.js";
|
|
8
8
|
const MAX_DATE = 8_640_000_000_000_000;
|
|
9
9
|
export class UPnPPortMapper {
|
|
10
10
|
gateway;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/upnp-nat",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.17-8f7e9264e",
|
|
4
4
|
"description": "UPnP NAT hole punching",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/upnp-nat#readme",
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"exports": {
|
|
30
30
|
".": {
|
|
31
31
|
"types": "./dist/src/index.d.ts",
|
|
32
|
-
"import": "./dist/src/index.js"
|
|
32
|
+
"import": "./dist/src/index.js",
|
|
33
|
+
"module-sync": "./dist/src/index.js"
|
|
33
34
|
}
|
|
34
35
|
},
|
|
35
36
|
"scripts": {
|
|
@@ -49,9 +50,9 @@
|
|
|
49
50
|
"dependencies": {
|
|
50
51
|
"@achingbrain/nat-port-mapper": "^4.0.4",
|
|
51
52
|
"@chainsafe/is-ip": "^2.1.0",
|
|
52
|
-
"@libp2p/interface": "
|
|
53
|
-
"@libp2p/interface-internal": "
|
|
54
|
-
"@libp2p/utils": "
|
|
53
|
+
"@libp2p/interface": "3.2.2-8f7e9264e",
|
|
54
|
+
"@libp2p/interface-internal": "3.1.2-8f7e9264e",
|
|
55
|
+
"@libp2p/utils": "7.0.17-8f7e9264e",
|
|
55
56
|
"@multiformats/multiaddr": "^13.0.1",
|
|
56
57
|
"@multiformats/multiaddr-matcher": "^3.0.1",
|
|
57
58
|
"main-event": "^1.0.1",
|
|
@@ -59,9 +60,9 @@
|
|
|
59
60
|
"race-signal": "^2.0.0"
|
|
60
61
|
},
|
|
61
62
|
"devDependencies": {
|
|
62
|
-
"@libp2p/crypto": "
|
|
63
|
-
"@libp2p/logger": "
|
|
64
|
-
"@libp2p/peer-id": "
|
|
63
|
+
"@libp2p/crypto": "5.1.17-8f7e9264e",
|
|
64
|
+
"@libp2p/logger": "6.2.6-8f7e9264e",
|
|
65
|
+
"@libp2p/peer-id": "6.0.8-8f7e9264e",
|
|
65
66
|
"aegir": "^47.0.22",
|
|
66
67
|
"sinon-ts": "^2.0.0",
|
|
67
68
|
"wherearewe": "^2.0.1"
|
package/src/index.ts
CHANGED
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
* ```
|
|
76
76
|
*/
|
|
77
77
|
|
|
78
|
-
import { UPnPNAT as UPnPNATClass } from './upnp-nat.
|
|
78
|
+
import { UPnPNAT as UPnPNATClass } from './upnp-nat.ts'
|
|
79
79
|
import type { UPnPNAT as UPnPNATClient, MapPortOptions } from '@achingbrain/nat-port-mapper'
|
|
80
80
|
import type { ComponentLogger, Libp2pEvents, NodeInfo, PeerId } from '@libp2p/interface'
|
|
81
81
|
import type { AddressManager } from '@libp2p/interface-internal'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { start, stop } from '@libp2p/interface'
|
|
2
2
|
import { repeatingTask } from '@libp2p/utils'
|
|
3
3
|
import { TypedEventEmitter } from 'main-event'
|
|
4
|
-
import { DEFAULT_GATEWAY_SEARCH_INTERVAL, DEFAULT_GATEWAY_SEARCH_MESSAGE_INTERVAL, DEFAULT_GATEWAY_SEARCH_TIMEOUT, DEFAULT_INITIAL_GATEWAY_SEARCH_INTERVAL, DEFAULT_INITIAL_GATEWAY_SEARCH_MESSAGE_INTERVAL, DEFAULT_INITIAL_GATEWAY_SEARCH_TIMEOUT } from './constants.
|
|
5
|
-
import type { GatewayFinder, GatewayFinderEvents } from './upnp-nat.
|
|
4
|
+
import { DEFAULT_GATEWAY_SEARCH_INTERVAL, DEFAULT_GATEWAY_SEARCH_MESSAGE_INTERVAL, DEFAULT_GATEWAY_SEARCH_TIMEOUT, DEFAULT_INITIAL_GATEWAY_SEARCH_INTERVAL, DEFAULT_INITIAL_GATEWAY_SEARCH_MESSAGE_INTERVAL, DEFAULT_INITIAL_GATEWAY_SEARCH_TIMEOUT } from './constants.ts'
|
|
5
|
+
import type { GatewayFinder, GatewayFinderEvents } from './upnp-nat.ts'
|
|
6
6
|
import type { Gateway, UPnPNAT } from '@achingbrain/nat-port-mapper'
|
|
7
7
|
import type { ComponentLogger, Logger } from '@libp2p/interface'
|
|
8
8
|
import type { RepeatingTask } from '@libp2p/utils'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TypedEventEmitter } from 'main-event'
|
|
2
|
-
import type { GatewayFinder, GatewayFinderEvents } from './upnp-nat.
|
|
2
|
+
import type { GatewayFinder, GatewayFinderEvents } from './upnp-nat.ts'
|
|
3
3
|
import type { Gateway, UPnPNAT } from '@achingbrain/nat-port-mapper'
|
|
4
4
|
import type { ComponentLogger, Logger } from '@libp2p/interface'
|
|
5
5
|
|
package/src/upnp-nat.browser.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { serviceCapabilities, serviceDependencies } from '@libp2p/interface'
|
|
2
|
-
import type { UPnPNATClient, UPnPNAT as UPnPNATInterface } from './index.
|
|
2
|
+
import type { UPnPNATClient, UPnPNAT as UPnPNATInterface } from './index.ts'
|
|
3
3
|
|
|
4
4
|
export class UPnPNAT implements UPnPNATInterface {
|
|
5
5
|
public portMappingClient: UPnPNATClient
|
package/src/upnp-nat.ts
CHANGED
|
@@ -2,10 +2,10 @@ import { upnpNat } from '@achingbrain/nat-port-mapper'
|
|
|
2
2
|
import { serviceCapabilities, serviceDependencies, start, stop } from '@libp2p/interface'
|
|
3
3
|
import { debounce } from '@libp2p/utils'
|
|
4
4
|
import { setMaxListeners } from 'main-event'
|
|
5
|
-
import { SearchGatewayFinder } from './search-gateway-finder.
|
|
6
|
-
import { StaticGatewayFinder } from './static-gateway-finder.
|
|
7
|
-
import { UPnPPortMapper } from './upnp-port-mapper.
|
|
8
|
-
import type { UPnPNATComponents, UPnPNATInit, UPnPNAT as UPnPNATInterface } from './index.
|
|
5
|
+
import { SearchGatewayFinder } from './search-gateway-finder.ts'
|
|
6
|
+
import { StaticGatewayFinder } from './static-gateway-finder.ts'
|
|
7
|
+
import { UPnPPortMapper } from './upnp-port-mapper.ts'
|
|
8
|
+
import type { UPnPNATComponents, UPnPNATInit, UPnPNAT as UPnPNATInterface } from './index.ts'
|
|
9
9
|
import type { Gateway, UPnPNAT as UPnPNATClient } from '@achingbrain/nat-port-mapper'
|
|
10
10
|
import type { Logger, Startable } from '@libp2p/interface'
|
|
11
11
|
import type { DebouncedFunction } from '@libp2p/utils'
|
package/src/upnp-port-mapper.ts
CHANGED
|
@@ -3,9 +3,9 @@ import { InvalidParametersError, start, stop } from '@libp2p/interface'
|
|
|
3
3
|
import { getNetConfig, isLinkLocal, isLoopback, isPrivate, isPrivateIp } from '@libp2p/utils'
|
|
4
4
|
import { multiaddr } from '@multiformats/multiaddr'
|
|
5
5
|
import { QUIC_V1, TCP, WebSockets, WebSocketsSecure, WebTransport } from '@multiformats/multiaddr-matcher'
|
|
6
|
-
import { dynamicExternalAddress, staticExternalAddress } from './check-external-address.
|
|
7
|
-
import { DoubleNATError } from './errors.
|
|
8
|
-
import type { ExternalAddress } from './check-external-address.
|
|
6
|
+
import { dynamicExternalAddress, staticExternalAddress } from './check-external-address.ts'
|
|
7
|
+
import { DoubleNATError } from './errors.ts'
|
|
8
|
+
import type { ExternalAddress } from './check-external-address.ts'
|
|
9
9
|
import type { Gateway } from '@achingbrain/nat-port-mapper'
|
|
10
10
|
import type { ComponentLogger, Logger } from '@libp2p/interface'
|
|
11
11
|
import type { AddressManager, NodeAddress } from '@libp2p/interface-internal'
|
package/dist/typedoc-urls.json
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"PMPOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_upnp-nat.PMPOptions.html",
|
|
3
|
-
".:PMPOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_upnp-nat.PMPOptions.html",
|
|
4
|
-
"UPnPNAT": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_upnp-nat.UPnPNAT.html",
|
|
5
|
-
".:UPnPNAT": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_upnp-nat.UPnPNAT.html",
|
|
6
|
-
"UPnPNATComponents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_upnp-nat.UPnPNATComponents.html",
|
|
7
|
-
".:UPnPNATComponents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_upnp-nat.UPnPNATComponents.html",
|
|
8
|
-
"UPnPNATInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_upnp-nat.UPnPNATInit.html",
|
|
9
|
-
".:UPnPNATInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_upnp-nat.UPnPNATInit.html",
|
|
10
|
-
"uPnPNAT": "https://libp2p.github.io/js-libp2p/functions/_libp2p_upnp-nat.uPnPNAT.html",
|
|
11
|
-
".:uPnPNAT": "https://libp2p.github.io/js-libp2p/functions/_libp2p_upnp-nat.uPnPNAT.html"
|
|
12
|
-
}
|