Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit a19ea64

Browse files
author
Alan Shaw
committed
fix: no listen in browser
1 parent bb05266 commit a19ea64

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/swarm/peers.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
const multiaddr = require('multiaddr')
55
const CID = require('cids')
66
const delay = require('delay')
7+
const { isNode } = require('ipfs-utils/src/env')
78
const { getDescribe, getIt, expect } = require('../utils/mocha')
89

910
/** @typedef { import("ipfsd-ctl/src/factory") } Factory */
@@ -98,10 +99,10 @@ module.exports = (common, options) => {
9899

99100
it('should list peers only once even if they have multiple addresses', async () => {
100101
// TODO: Change to port 0, needs: https://github.com/ipfs/interface-ipfs-core/issues/152
101-
const configA = getConfig([
102+
const configA = getConfig(isNode ? [ // browser nodes cannot listen
102103
'/ip4/127.0.0.1/tcp/16543',
103104
'/ip4/127.0.0.1/tcp/16544'
104-
])
105+
] : [])
105106
const configB = getConfig([
106107
'/ip4/127.0.0.1/tcp/26545/ws',
107108
'/ip4/127.0.0.1/tcp/26546/ws'

0 commit comments

Comments
 (0)