Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept lists of ports #26

Closed
sholladay opened this issue Jan 2, 2015 · 8 comments
Closed

Accept lists of ports #26

sholladay opened this issue Jan 2, 2015 · 8 comments

Comments

@sholladay
Copy link

The APIs for this module would be much more useful if they could also consume lists of ports that we deem acceptable, in addition to the current startPort and endPort abilities. This will help prevent accidentally hogging specific ports, and therefor clashing with other services used in our projects, without forcing us to restrict the scanning range to something above or below those points. For example, I should be able to instruct portscanner to choose one out of exactly n number of specific ports.

portscanner.findAPortNotInUse([4443, 4444, 4447], '127.0.0.1', function(error, port) {
    console.log('Available port: ' + port);
});

And that should never give me a port I did not list explicitly.

@sholladay
Copy link
Author

FYI, I have posted a bounty for this issue on Bountysource.
https://www.bountysource.com/issues/7446655-accept-lists-of-ports

@darthneko
Copy link
Contributor

Modified existing methods to work with a list of ports instead of a starting port and ending port. #28

@darthneko
Copy link
Contributor

Revised suggested changes. #28

@darthneko
Copy link
Contributor

Please, review this pull request and either state why functionality isn't right or approve closing of the issue. #28

@sholladay
Copy link
Author

Edited to clarify that my desired behavior is to add the ability to consume lists, without replacing or destroying the current startPort and endPort abilities. They should not be mutually exclusive. I see no reason this has to be a breaking change.

@darthneko
Copy link
Contributor

It's the exact functionality of this branch #28 .

@laggingreflex
Copy link
Collaborator

This has been added. Released a new minor version 1.1.0, please check it out and let me know.

@laggingreflex
Copy link
Collaborator

It turns out v1.1.0 broke portscanner in some cases and the changes that broke it were actually the changes required to fix this exact issue. For that reason I've published the new changes as v2.0.0. I'm sorry this feature couldn't make it a minor version. I've addressed the issue here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants