File tree 2 files changed +9
-5
lines changed
add-on/src/lib/ipfs-client/embedded-chromesockets
2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -23,9 +23,9 @@ const chromeSocketsOpts = {
23
23
*/
24
24
Swarm : [
25
25
// TODO: listening on TCP (override IP and port at runtime in buildConfig()?)
26
- '/ip4/0.0.0.0/tcp/0'
27
- // TODO: disabled -star signaling: it makes a backup non-LAN peer discovery, but break the boot if server is down
28
- // '/dns4/ws-star1.par.dwebops.pub.com/tcp/443/wss/p2p-websocket-star'
26
+ '/ip4/0.0.0.0/tcp/0' ,
27
+ // optional ws -star signaling provides a backup non-LAN peer discovery
28
+ '/dns4/ws-star1.par.dwebops.pub.com/tcp/443/wss/p2p-websocket-star'
29
29
] ,
30
30
// Delegated Content and Peer Routing: https://github.com/ipfs/js-ipfs/pull/2195
31
31
Delegates : // [] // TODO: enable delegates
Original file line number Diff line number Diff line change @@ -18,10 +18,14 @@ const multiaddr = require('multiaddr')
18
18
class Libp2pChromeSockets extends libp2p {
19
19
constructor ( _options ) {
20
20
// this can be replaced once optional listening is supported with the below code. ref: https://github.com/libp2p/interface-transport/issues/41
21
- // const wsstar = new WebSocketStar({ id: _options.peerInfo.id })
21
+ // const wsstar = new WebSocketStar({ id: _options.peerInfo.id, ignore_no_online: true })
22
22
const wsstarServers = _options . peerInfo . multiaddrs . toArray ( ) . map ( String ) . filter ( addr => addr . includes ( 'p2p-websocket-star' ) )
23
23
_options . peerInfo . multiaddrs . replace ( wsstarServers . map ( multiaddr ) , '/p2p-websocket-star' ) // the ws-star-multi module will replace this with the chosen ws-star servers
24
- const wsstar = new WebSocketStarMulti ( { servers : wsstarServers , id : _options . peerInfo . id , ignore_no_online : ! wsstarServers . length || _options . wsStarIgnoreErrors } )
24
+ const wsstar = new WebSocketStarMulti ( {
25
+ servers : wsstarServers ,
26
+ id : _options . peerInfo . id ,
27
+ ignore_no_online : true // allow scenario when all ws-stars are offline
28
+ } )
25
29
26
30
const defaults = {
27
31
switch : {
You can’t perform that action at this time.
0 commit comments