This repository was archived by the owner on Feb 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 682
fix: make port 0 bind to any available port
#4070
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
davidmurdoch
commented
Dec 21, 2022
davidmurdoch
commented
Dec 21, 2022
davidmurdoch
commented
Dec 21, 2022
davidmurdoch
commented
Dec 21, 2022
davidmurdoch
commented
Dec 21, 2022
davidmurdoch
commented
Dec 21, 2022
davidmurdoch
commented
Dec 21, 2022
0 bind to any available port
jeffsmale90
suggested changes
Dec 21, 2022
MicaiahReid
suggested changes
Dec 21, 2022
Co-authored-by: Micaiah Reid <[email protected]>
Co-authored-by: Micaiah Reid <[email protected]>
e31067a to
8925f6d
Compare
davidmurdoch
commented
Jan 6, 2023
0 bind to any available port0 bind to any available port
MicaiahReid
approved these changes
Jan 6, 2023
Contributor
MicaiahReid
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a fix because we claimed to support binding to port 0.
jeffsmale90
approved these changes
Jan 8, 2023
0 bind to any available port0 bind to any available port
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Specifying a port of
0is a way to tell a server that you want the Operating System to let you bind to any open port. Ganache claimed to support binding to port 0, but would rudely yell at you if you tried:Port should be >= 0 and < 65536. Received 0🤦! This PR rights our wrongs.Using port
0is useful when you don't care which port you bind to, you just want an open port.You can use port
0in a few ways:On the cli:
In detach mode:
and programmatically:
Fixes #2643 and #3805