multiserver
Advanced tools
Comparing version 1.13.2 to 1.13.3
12
index.js
@@ -39,6 +39,10 @@ var compose = require('./compose') | ||
if (!scope) scope = 'public' | ||
return plugs.map(function (plug) { | ||
if (plug.scope() == scope || (plug.scope() == 'public' && scope == 'private')) | ||
return plug.stringify(scope) | ||
}).filter(Boolean).join(';') | ||
return plugs | ||
.filter(function (plug) { | ||
return plug.scope() === scope || | ||
(plug.scope() === 'public' && scope === 'private') | ||
}) | ||
.map(function (plug) { return plug.stringify(scope) }) | ||
.filter(Boolean) | ||
.join(';') | ||
}, | ||
@@ -45,0 +49,0 @@ //parse doesn't really make sense here... |
{ | ||
"name": "multiserver", | ||
"description": "write a server which works over many protocols at once, or connect to the same", | ||
"version": "1.13.2", | ||
"version": "1.13.3", | ||
"homepage": "https://github.com/dominictarr/multiserver", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -19,3 +19,3 @@ var net | ||
name: 'net', | ||
scope: function() { return opts.scope }, | ||
scope: function() { return opts.scope || 'public' }, | ||
server: function (onConnection) { | ||
@@ -68,3 +68,3 @@ var server = net.createServer(opts, function (stream) { | ||
var host = opts.external || opts.host || 'localhost' | ||
if (scope == 'private') | ||
if (scope === 'private') | ||
host = opts.host || 'localhost' | ||
@@ -71,0 +71,0 @@ return ['net', host, opts.port].join(':') |
@@ -7,3 +7,3 @@ var socks = require('socks').SocksClient; | ||
console.warn('onion dialing through socks proxy not supported in browser setting') | ||
return | ||
return | ||
} | ||
@@ -20,3 +20,3 @@ | ||
name: 'onion', | ||
scope: function() { return opts.scope }, | ||
scope: function() { return opts.scope || 'public' }, | ||
server: function (onConnection) { | ||
@@ -23,0 +23,0 @@ if(!opts.server) return |
@@ -12,7 +12,7 @@ var toPull = require('stream-to-pull-stream') | ||
const addr = 'unix:' + socket | ||
opts = opts || {} | ||
return { | ||
name: 'unix', | ||
scope: function() { return opts.scope }, | ||
scope: function() { return opts.scope || 'public' }, | ||
server: function (onConnection) { | ||
@@ -30,3 +30,3 @@ if(started) return | ||
clientSocket.on('error', function(e) { | ||
if (e.code == 'ECONNREFUSED') { | ||
if (e.code == 'ECONNREFUSED') { | ||
fs.unlinkSync(socket) | ||
@@ -36,4 +36,4 @@ server.listen(socket) | ||
}) | ||
clientSocket.connect({ path: socket }, function() { | ||
clientSocket.connect({ path: socket }, function() { | ||
console.log("someone else is listening on socket!") | ||
@@ -43,7 +43,7 @@ }) | ||
}) | ||
fs.chmodSync(socket, 0600) | ||
started = true | ||
return function () { | ||
@@ -50,0 +50,0 @@ server.close() |
@@ -12,3 +12,3 @@ var WS = require('pull-ws') | ||
name: 'ws', | ||
scope: function() { return opts.scope }, | ||
scope: function() { return opts.scope || 'public' }, | ||
server: function (onConnect) { | ||
@@ -15,0 +15,0 @@ if(!WS.createServer) return |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34783
873
3