From ab0ac91bc97e231bce29c0250f636dc6225922a9 Mon Sep 17 00:00:00 2001 From: Oli Evans Date: Wed, 29 May 2019 14:52:38 +0100 Subject: [PATCH] fix: shim setImmediate in browser Adding condig to use webrtc in a js-ipfs browser node as per https://github.com/ipfs/js-ipfs#how-to-enable-webrtc-support-for-js-ipfs-in-the-browser triggered errors about unqualifed setImmediate use in dialler. License: MIT Signed-off-by: Oli Evans --- src/circuit/dialer.js | 1 + src/circuit/hop.js | 1 + 2 files changed, 2 insertions(+) diff --git a/src/circuit/dialer.js b/src/circuit/dialer.js index 3b7fa7a..5e202d4 100644 --- a/src/circuit/dialer.js +++ b/src/circuit/dialer.js @@ -3,6 +3,7 @@ const once = require('once') const PeerId = require('peer-id') const waterfall = require('async/waterfall') +const setImmediate = require('async/setImmediate') const multiaddr = require('multiaddr') const Connection = require('interface-connection').Connection diff --git a/src/circuit/hop.js b/src/circuit/hop.js index 1ec4e1e..f93134e 100644 --- a/src/circuit/hop.js +++ b/src/circuit/hop.js @@ -12,6 +12,7 @@ const proto = require('../protocol').CircuitRelay const multiaddr = require('multiaddr') const series = require('async/series') const waterfall = require('async/waterfall') +const setImmediate = require('async/setImmediate') const multicodec = require('./../multicodec')