Compare commits

...

3 Commits

Author SHA1 Message Date
8661c09b69 chore: release version v0.15.2 2020-12-28 09:54:14 +00:00
f9e329708d chore: update contributors 2020-12-28 09:54:14 +00:00
af9804e778 fix: intermittent error when asking for interfaces (#137)
Get interfaces only once per run
2020-12-28 09:49:48 +00:00
3 changed files with 35 additions and 4 deletions

View File

@ -1,3 +1,32 @@
<a name="0.15.2"></a>
## [0.15.2](https://github.com/libp2p/js-libp2p-tcp/compare/v0.14.2...v0.15.2) (2020-12-28)
### Bug Fixes
* catch error from maConn.close ([#128](https://github.com/libp2p/js-libp2p-tcp/issues/128)) ([0fe0815](https://github.com/libp2p/js-libp2p-tcp/commit/0fe0815))
* catch thrown maConn errors in listener ([#122](https://github.com/libp2p/js-libp2p-tcp/issues/122)) ([86db568](https://github.com/libp2p/js-libp2p-tcp/commit/86db568)), closes [#121](https://github.com/libp2p/js-libp2p-tcp/issues/121)
* intermittent error when asking for interfaces ([#137](https://github.com/libp2p/js-libp2p-tcp/issues/137)) ([af9804e](https://github.com/libp2p/js-libp2p-tcp/commit/af9804e))
* remove use of assert module ([#123](https://github.com/libp2p/js-libp2p-tcp/issues/123)) ([6272876](https://github.com/libp2p/js-libp2p-tcp/commit/6272876))
* transport should not handle connection if upgradeInbound throws ([#119](https://github.com/libp2p/js-libp2p-tcp/issues/119)) ([21f8747](https://github.com/libp2p/js-libp2p-tcp/commit/21f8747))
### Chores
* update deps ([#134](https://github.com/libp2p/js-libp2p-tcp/issues/134)) ([d9f9912](https://github.com/libp2p/js-libp2p-tcp/commit/d9f9912))
### BREAKING CHANGES
* - The multiaddr dep used by this module returns Uint8Arrays and may
not be compatible with previous versions
* chore: update utils
* chore: remove gh dep url
<a name="0.15.1"></a>
## [0.15.1](https://github.com/libp2p/js-libp2p-tcp/compare/v0.15.0...v0.15.1) (2020-08-11)

View File

@ -1,6 +1,6 @@
{
"name": "libp2p-tcp",
"version": "0.15.1",
"version": "0.15.2",
"description": "Node.js implementation of the TCP module that libp2p uses, which implements the interface-connection and interface-transport interfaces",
"leadMaintainer": "Jacob Heun <jacobheun@gmail.com>",
"main": "src/index.js",
@ -59,13 +59,14 @@
"Richard Littauer <richard.littauer@gmail.com>",
"Tom White <tomtinkerer@gmail.com>",
"Alan Shaw <alan@tableflip.io>",
"Prashanth Chandra <coolshanth94@gmail.com>",
"João Antunes <j.goncalo.antunes@gmail.com>",
"Diogo Silva <fsdiogo@gmail.com>",
"Dmitriy Ryajov <dryajov@gmail.com>",
"Drew Stone <drewstone329@gmail.com>",
"Evan Schwartz <evan.mark.schwartz@gmail.com>",
"Linus Unnebäck <linus@folkdatorn.se>",
"Pedro Teixeira <i@pgte.me>",
"Prashanth Chandra <coolshanth94@gmail.com>"
"Mikeal Rogers <mikeal.rogers@gmail.com>",
"Pedro Teixeira <i@pgte.me>"
]
}

View File

@ -29,8 +29,9 @@ function isAnyAddr (ip) {
* @param {string} family One of ['IPv6', 'IPv4']
* @returns {string[]} an array of ip address strings
*/
const networks = os.networkInterfaces()
function getNetworkAddrs (family) {
return Object.values(os.networkInterfaces()).reduce((addresses, netAddrs) => {
return Object.values(networks).reduce((addresses, netAddrs) => {
netAddrs.forEach(netAddr => {
// Add the ip of each matching network interface
if (netAddr.family === family) addresses.push(netAddr.address)