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

Fall back to a random port if preferred port is privileged #39

Merged
merged 3 commits into from Dec 18, 2019
Merged

Fall back to a random port if preferred port is privileged #39

merged 3 commits into from Dec 18, 2019

Conversation

mjgallag
Copy link
Contributor

Note that the test is using 127.0.0.1 so that it can run on MacOS, which stopped enforcing privileged ports in 10.14 and later, see https://news.ycombinator.com/item?id=18302380. Unfortunately, it's possible this is a bug and that Apple could fix it in the future, but test still passes as of MacOS 10.15.2. The test will also fail if run as root on Linux, but I don't think they should typically be running as root. If anyone has any better ideas, please do suggest!

Closes #38

@sindresorhus sindresorhus changed the title Fall back to a random port if prefered port is privileged Fall back to a random port if preferred port is privileged Dec 18, 2019
@sindresorhus sindresorhus merged commit 45a71bc into sindresorhus:master Dec 18, 2019
@mjgallag mjgallag deleted the fall-back-to-a-random-port-if-prefered-port-is-privileged branch December 18, 2019 17:12
@@ -32,7 +32,7 @@ test('preferred port unavailable', async t => {
t.not(port, desiredPort);
});

test('preferred port priviliged', async t => {
test('preferred port privileged', async t => {
Copy link
Contributor Author

@mjgallag mjgallag Dec 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, thanks for catching this typo @sindresorhus, and thanks for the quick merge!

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

Successfully merging this pull request may close these issues.

Fall back to a random port if prefered port is privileged
2 participants