Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
swarm.Pipe = Pipe;
swarm.ID = ID;
swarm.Spec = Spec;
swarm.Plumber = Plumber;
if (typeof(module)!=='undefined') {
WebSocket = require('ws');
crypto = require('crypto');
}
if (typeof(WebSocket)!=='undefined')
Plumber.schemes['ws'] = WebSocket;
WebSocket._p = WebSocket.prototype;
if (!WebSocket._p.on)
WebSocket._p.on = WebSocket._p.addEventListener;
if (!WebSocket.off)
WebSocket._p.off = WebSocket._p.removeEventListener;
/* Pain points
* * base refac
* * basic acl/security (by hexghost)
* * * * *
*
* */
/*function expectedSecret (id) {
var hash = crypto.createHash('sha1');
hash.update(id.toString());
hash.update(self.host.masterSecret);
return hash.digest('base64');
}*/
swarm.Spec = Spec;
swarm.Plumber = Plumber;
if (typeof(module)!=='undefined') {
WebSocket = require('ws');
crypto = require('crypto');
}
if (typeof(WebSocket)!=='undefined')
Plumber.schemes['ws'] = WebSocket;
WebSocket._p = WebSocket.prototype;
if (!WebSocket._p.on)
WebSocket._p.on = WebSocket._p.addEventListener;
if (!WebSocket.off)
WebSocket._p.off = WebSocket._p.removeEventListener;
/* Pain points
* * base refac
* * basic acl/security (by hexghost)
* * * * *
*
* */
/*function expectedSecret (id) {
var hash = crypto.createHash('sha1');
hash.update(id.toString());
hash.update(self.host.masterSecret);
return hash.digest('base64');
}*/
swarm.Peer = Peer;
swarm.Pipe = Pipe;
swarm.ID = ID;
swarm.Spec = Spec;
swarm.Plumber = Plumber;
if (typeof(module)!=='undefined') {
WebSocket = require('ws');
crypto = require('crypto');
}
if (typeof(WebSocket)!=='undefined')
Plumber.schemes['ws'] = WebSocket;
WebSocket._p = WebSocket.prototype;
if (!WebSocket._p.on)
WebSocket._p.on = WebSocket._p.addEventListener;
if (!WebSocket.off)
WebSocket._p.off = WebSocket._p.removeEventListener;
/* Pain points
* * base refac
* * basic acl/security (by hexghost)
* * * * *
*
* */
/*function expectedSecret (id) {
var hash = crypto.createHash('sha1');
hash.update(id.toString());
hash.update(self.host.masterSecret);
return hash.digest('base64');
}*/