libp2p-tcp
Advanced tools
Comparing version 0.15.3 to 0.15.4
@@ -0,1 +1,10 @@ | ||
## [0.15.4](https://github.com/libp2p/js-libp2p-tcp/compare/v0.15.2...v0.15.4) (2021-04-12) | ||
### Bug Fixes | ||
* hanging close promise ([#140](https://github.com/libp2p/js-libp2p-tcp/issues/140)) ([3813100](https://github.com/libp2p/js-libp2p-tcp/commit/381310043852a9213f1abb62f5f0a7046d806286)) | ||
<a name="0.15.3"></a> | ||
@@ -2,0 +11,0 @@ ## [0.15.3](https://github.com/libp2p/js-libp2p-tcp/compare/v0.15.2...v0.15.3) (2021-02-03) |
{ | ||
"name": "libp2p-tcp", | ||
"version": "0.15.3", | ||
"version": "0.15.4", | ||
"description": "Node.js implementation of the TCP module that libp2p uses, which implements the interface-connection and interface-transport interfaces", | ||
@@ -24,3 +24,9 @@ "leadMaintainer": "Jacob Heun <jacobheun@gmail.com>", | ||
"keywords": [ | ||
"IPFS" | ||
"libp2p", | ||
"network", | ||
"p2p", | ||
"peer", | ||
"peer-to-peer", | ||
"IPFS", | ||
"TCP" | ||
], | ||
@@ -33,10 +39,9 @@ "license": "MIT", | ||
"engines": { | ||
"node": ">=6.0.0", | ||
"npm": ">=3.0.0" | ||
"node": ">=14.0.0" | ||
}, | ||
"devDependencies": { | ||
"aegir": "^25.0.0", | ||
"aegir": "^33.0.0", | ||
"it-pipe": "^1.1.0", | ||
"libp2p-interfaces": "^0.4.0", | ||
"sinon": "^9.0.0", | ||
"libp2p-interfaces": "^0.9.0", | ||
"sinon": "^10.0.1", | ||
"streaming-iterables": "^5.0.2" | ||
@@ -47,7 +52,7 @@ }, | ||
"class-is": "^1.1.0", | ||
"debug": "^4.1.1", | ||
"err-code": "^2.0.0", | ||
"libp2p-utils": "^0.2.0", | ||
"mafmt": "^8.0.0", | ||
"multiaddr": "^8.0.0", | ||
"debug": "^4.3.1", | ||
"err-code": "^3.0.1", | ||
"libp2p-utils": "^0.3.0", | ||
"mafmt": "^9.0.0", | ||
"multiaddr": "^9.0.1", | ||
"stream-to-it": "^0.2.2" | ||
@@ -67,2 +72,3 @@ }, | ||
"Prashanth Chandra <coolshanth94@gmail.com>", | ||
"Ryan Mehta <ryan.mehta@gmail.com>", | ||
"João Antunes <j.goncalo.antunes@gmail.com>", | ||
@@ -69,0 +75,0 @@ "Cayman <caymannava@gmail.com>", |
@@ -12,7 +12,7 @@ # js-libp2p-tcp | ||
[![](https://raw.githubusercontent.com/libp2p/interface-transport/master/img/badge.png)](https://github.com/libp2p/interface-transport) | ||
[![](https://raw.githubusercontent.com/libp2p/interface-connection/master/img/badge.png)](https://github.com/libp2p/interface-connection) | ||
[![](https://raw.githubusercontent.com/libp2p/js-libp2p-interfaces/master/src/transport/img/badge.png)](https://github.com/libp2p/js-libp2p-interfaces/tree/master/src/transport) | ||
[![](https://raw.githubusercontent.com/libp2p/js-libp2p-interfaces/master/src/connection/img/badge.png)](https://github.com/libp2p/js-libp2p-interfaces/tree/master/src/connection) | ||
> JavaScript implementation of the TCP module for libp2p. It exposes the [interface-transport](https://github.com/libp2p/interface-connection) for dial/listen. `libp2p-tcp` is a very thin shim that adds support for dialing to a `multiaddr`. This small shim will enable libp2p to use other transports. | ||
> JavaScript implementation of the TCP module for libp2p. It exposes the [interface-transport](https://github.com/libp2p/js-libp2p-interfaces/tree/master/src/transport) for dial/listen. `libp2p-tcp` is a very thin shim that adds support for dialing to a `multiaddr`. This small shim will enable libp2p to use other transports. | ||
@@ -91,3 +91,3 @@ ## Lead Maintainer | ||
[![](https://raw.githubusercontent.com/libp2p/interface-transport/master/img/badge.png)](https://github.com/libp2p/interface-transport) | ||
[![](https://raw.githubusercontent.com/libp2p/js-libp2p-interfaces/master/src/transport/img/badge.png)](https://github.com/libp2p/js-libp2p-interfaces/tree/master/src/transport) | ||
@@ -103,4 +103,5 @@ `libp2p-tcp` accepts TCP addresses as both IPFS and non IPFS encapsulated addresses, i.e: | ||
[![](https://raw.githubusercontent.com/libp2p/interface-connection/master/img/badge.png)](https://github.com/libp2p/interface-connection) | ||
[![](https://raw.githubusercontent.com/libp2p/js-libp2p-interfaces/master/src/connection/img/badge.png)](https://github.com/libp2p/js-libp2p-interfaces/tree/master/src/connection) | ||
## Contribute | ||
@@ -107,0 +108,0 @@ |
@@ -15,7 +15,9 @@ 'use strict' | ||
/** | ||
* @class TCP | ||
* @typedef {import('multiaddr').Multiaddr} Multiaddr | ||
* @typedef {import('libp2p-interfaces/src/connection').Connection} Connection | ||
*/ | ||
class TCP { | ||
/** | ||
* @constructor | ||
* @class | ||
* @param {object} options | ||
@@ -35,3 +37,3 @@ * @param {Upgrader} options.upgrader | ||
* @param {object} options | ||
* @param {AbortSignal} options.signal Used to abort dial requests | ||
* @param {AbortSignal} options.signal - Used to abort dial requests | ||
* @returns {Connection} An upgraded Connection | ||
@@ -53,3 +55,3 @@ */ | ||
* @param {object} options | ||
* @param {AbortSignal} options.signal Used to abort dial requests | ||
* @param {AbortSignal} options.signal - Used to abort dial requests | ||
* @returns {Promise<Socket>} Resolves a TCP Socket | ||
@@ -113,2 +115,3 @@ */ | ||
* `upgrader.upgradeInbound`. | ||
* | ||
* @param {*} [options] | ||
@@ -129,2 +132,3 @@ * @param {function(Connection)} handler | ||
* Takes a list of `Multiaddr`s and returns only valid TCP addresses | ||
* | ||
* @param {Multiaddr[]} multiaddrs | ||
@@ -131,0 +135,0 @@ * @returns {Multiaddr[]} Valid TCP multiaddrs |
@@ -18,4 +18,5 @@ 'use strict' | ||
* Attempts to close the given maConn. If a failure occurs, it will be logged. | ||
* | ||
* @private | ||
* @param {MultiaddrConnection} maConn | ||
* @param {import('libp2p-interfaces/src/transport/types').MultiaddrConnection} maConn | ||
*/ | ||
@@ -22,0 +23,0 @@ async function attemptClose (maConn) { |
'use strict' | ||
const multiaddr = require('multiaddr') | ||
const { Multiaddr } = require('multiaddr') | ||
const os = require('os') | ||
@@ -19,3 +19,3 @@ const { resolve } = require('path') | ||
function getMultiaddrs (proto, ip, port) { | ||
const toMa = ip => multiaddr(`/${proto}/${ip}/tcp/${port}`) | ||
const toMa = ip => new Multiaddr(`/${proto}/${ip}/tcp/${port}`) | ||
return (isAnyAddr(ip) ? getNetworkAddrs(ProtoFamily[proto]) : [ip]).map(toMa) | ||
@@ -30,3 +30,3 @@ } | ||
* @private | ||
* @param {string} family One of ['IPv6', 'IPv4'] | ||
* @param {string} family - One of ['IPv6', 'IPv4'] | ||
* @returns {string[]} an array of ip address strings | ||
@@ -33,0 +33,0 @@ */ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found
Found 1 instance in 1 package
0
100
119
32300
10
356
3
+ Addederr-code@3.0.1(transitive)
+ Addedip-address@7.1.0(transitive)
+ Addedlibp2p-utils@0.3.1(transitive)
+ Addedmafmt@9.0.0(transitive)
+ Addedmultiaddr@9.0.2(transitive)
+ Addeduint8arrays@2.1.10(transitive)
- Removed@zxing/text-encoding@0.9.0(transitive)
- Removedavailable-typed-arrays@1.0.7(transitive)
- Removedcall-bind@1.0.7(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removederr-code@2.0.3(transitive)
- Removedes-define-property@1.0.0(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedfor-each@0.3.3(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-intrinsic@1.2.4(transitive)
- Removedgopd@1.0.1(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.0.3(transitive)
- Removedhas-symbols@1.0.3(transitive)
- Removedhas-tostringtag@1.0.2(transitive)
- Removedhasown@2.0.2(transitive)
- Removedinherits@2.0.4(transitive)
- Removedip-address@6.4.0(transitive)
- Removedis-arguments@1.1.1(transitive)
- Removedis-callable@1.2.7(transitive)
- Removedis-generator-function@1.0.10(transitive)
- Removedis-typed-array@1.1.13(transitive)
- Removedlibp2p-utils@0.2.3(transitive)
- Removedlodash.find@4.6.0(transitive)
- Removedlodash.max@4.0.1(transitive)
- Removedlodash.merge@4.6.2(transitive)
- Removedlodash.padstart@4.6.1(transitive)
- Removedlodash.repeat@4.1.0(transitive)
- Removedmafmt@8.0.4(transitive)
- Removedmultiaddr@8.1.2(transitive)
- Removedmultibase@3.1.2(transitive)
- Removedpossible-typed-array-names@1.0.0(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removeduint8arrays@1.1.0(transitive)
- Removedutil@0.12.5(transitive)
- Removedweb-encoding@1.1.5(transitive)
- Removedwhich-typed-array@1.1.15(transitive)
Updateddebug@^4.3.1
Updatederr-code@^3.0.1
Updatedlibp2p-utils@^0.3.0
Updatedmafmt@^9.0.0
Updatedmultiaddr@^9.0.1