Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Support binding to port 0 #2643

Closed
BlinkyStitt opened this issue Mar 19, 2022 · 3 comments · Fixed by #4070
Closed

Support binding to port 0 #2643

BlinkyStitt opened this issue Mar 19, 2022 · 3 comments · Fixed by #4070

Comments

@BlinkyStitt
Copy link

If you ask linux to bind to port 0, it will automatically pick an open port for you. This can be really helpful when running multiple instances of ganache on the same machine. Currently, ganache says Invalid port number '0'

Please make ganache support binding to port 0.

It would also be helpful (though not necessary) if it wrote this port to a file somewhere.

@davidmurdoch
Copy link
Member

davidmurdoch commented Mar 19, 2022

uWebSockets, the library we use, does support this. We just need to provide a way for the user to get this port - we should probably just copy node's API here.

We'll also need to update our fork of uwebsockets as I don't think the fallback exposes the feature.

Additional context may be found in this PR comment.

Would you like to work this issue?

@BlinkyStitt
Copy link
Author

You probably don't want me writing any JavaScript haha

@davidmurdoch
Copy link
Member

Haha. No worries. Do you know of any cli tools that can "bind" to port 0 and then output the actual port to a file?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants