@libp2p/interface-internal 2.1.1-b248eefc0 → 2.1.1-bc90b4fd5

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.
@@ -44,5 +44,20 @@ export interface AddressManager {
44
44
  * Remove a mapping previously added with `addDNSMapping`.
45
45
  */
46
46
  removeDNSMapping(domain: string): void;
47
+ /**
48
+ * Add a publicly routable address/port/protocol tuple that this node is
49
+ * reachable on. Where this node listens on a link-local (e.g. LAN) address
50
+ * with the same protocol for any transport, an additional listen address will
51
+ * be added with the IP and port replaced with this IP and port.
52
+ *
53
+ * It's possible to add a IPv6 address here and have it added to the address
54
+ * list, this is for the case when a router has an external IPv6 address with
55
+ * port forwarding configured, but it does IPv6 -> IPv4 NAT.
56
+ */
57
+ addPublicAddressMapping(internalIp: string, internalPort: number, externalIp: string, externalPort?: number, protocol?: 'tcp' | 'udp'): void;
58
+ /**
59
+ * Remove a publicly routable address that this node is no longer reachable on
60
+ */
61
+ removePublicAddressMapping(internalIp: string, internalPort: number, externalIp: string, externalPort?: number, protocol?: 'tcp' | 'udp'): void;
47
62
  }
48
63
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/address-manager/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,cAAc,IAAI,SAAS,EAAE,CAAA;IAE7B;;OAEG;IACH,gBAAgB,IAAI,SAAS,EAAE,CAAA;IAE/B;;;OAGG;IACH,gBAAgB,IAAI,SAAS,EAAE,CAAA;IAE/B;;;OAGG;IACH,mBAAmB,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAAA;IAE1C;;;OAGG;IACH,kBAAkB,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAAA;IAEzC;;;;OAIG;IACH,eAAe,CAAC,IA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E,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,IAAI,CAAA;CACjJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libp2p/interface-internal",
3
- "version": "2.1.1-b248eefc0",
3
+ "version": "2.1.1-bc90b4fd5",
4
4
  "description": "Interfaces implemented by internal libp2p components",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/interface-internal#readme",
@@ -48,8 +48,8 @@
48
48
  "build": "aegir build"
49
49
  },
50
50
  "dependencies": {
51
- "@libp2p/interface": "2.2.1-b248eefc0",
52
- "@libp2p/peer-collections": "6.0.12-b248eefc0",
51
+ "@libp2p/interface": "2.2.1-bc90b4fd5",
52
+ "@libp2p/peer-collections": "6.0.12-bc90b4fd5",
53
53
  "@multiformats/multiaddr": "^12.2.3",
54
54
  "progress-events": "^1.0.0",
55
55
  "uint8arraylist": "^2.4.8"
@@ -53,4 +53,21 @@ export interface AddressManager {
53
53
  * Remove a mapping previously added with `addDNSMapping`.
54
54
  */
55
55
  removeDNSMapping(domain: string): void
56
+
57
+ /**
58
+ * Add a publicly routable address/port/protocol tuple that this node is
59
+ * reachable on. Where this node listens on a link-local (e.g. LAN) address
60
+ * with the same protocol for any transport, an additional listen address will
61
+ * be added with the IP and port replaced with this IP and port.
62
+ *
63
+ * It's possible to add a IPv6 address here and have it added to the address
64
+ * list, this is for the case when a router has an external IPv6 address with
65
+ * port forwarding configured, but it does IPv6 -> IPv4 NAT.
66
+ */
67
+ addPublicAddressMapping (internalIp: string, internalPort: number, externalIp: string, externalPort?: number, protocol?: 'tcp' | 'udp'): void
68
+
69
+ /**
70
+ * Remove a publicly routable address that this node is no longer reachable on
71
+ */
72
+ removePublicAddressMapping (internalIp: string, internalPort: number, externalIp: string, externalPort?: number, protocol?: 'tcp' | 'udp'): void
56
73
  }