Socket
Socket
Sign inDemoInstall

openport

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.4 to 0.0.5

7

package.json

@@ -6,3 +6,3 @@ {

"keywords": ["port", "network", "open"],
"version": "0.0.4",
"version": "0.0.5",
"engines": { "node" : ">=0.6.0" },

@@ -13,4 +13,7 @@ "maintainers": [

"devDependencies": {
"nodeunit": "0.7.3"
"nodeunit": "0.10.2"
},
"scripts": {
"test": "./node_modules/nodeunit/bin/nodeunit test"
},
"bugs": { "url": "https://github.com/joeferner/node-openport/issues" },

@@ -17,0 +20,0 @@ "license": "MIT",

@@ -232,4 +232,56 @@ 'use strict';

});
}
},
'finds open port on mismatched ip V 4 to 6 (and vice versa)': function (test) {
var server = net.createServer();
// start on ipV4
server.listen({ host: '0.0.0.0', port: 1024 }, function () {
op.find(
{
ports: [ 1024, 1025 ]
},
function (err, port) {
test.ok(!err);
test.notEqual(1025, port, 'uh oh we looked for ipV6');
test.equals(1024, port, 'yup I\'m a bozo');
server.close();
test.done();
});
});
},
'finds open port on matched IPv4': function (test) {
var server = net.createServer();
// start on ipV4
server.listen({ host: '0.0.0.0', port: 1024 }, function () {
op.find(
{
host: '0.0.0.0',
ports: [ 1024, 1025 ]
},
function (err, port) {
test.ok(!err);
test.equals(1025, port);
server.close();
test.done();
});
});
},
'finds open port on matched IPv4 with start and ending ports': function (test) {
var server = net.createServer();
// start on ipV4
server.listen({ host: '0.0.0.0', port: 1024 }, function () {
op.find(
{
host: '0.0.0.0',
startingPort: 1024,
endingPort: 1025,
},
function (err, port) {
test.ok(!err);
test.equals(1025, port);
server.close();
test.done();
});
});
},
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc