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

support using kernel assigned (random) port #39

Open
smoser opened this issue Aug 25, 2023 · 0 comments
Open

support using kernel assigned (random) port #39

smoser opened this issue Aug 25, 2023 · 0 comments

Comments

@smoser
Copy link

smoser commented Aug 25, 2023

In some cases, knowing that a port will available is difficult.
Rather than guessing, it would be good to allow '--port=0' to let the kernel pick a port and have ran use that.

conveying the port to a consumer would be helpful but not entirely necessary. then you could do something like:

ran --port=0 my.dir > my.log 2>&1 &
url=""
while [ -z "$url" ];  do
  url=$(awk '$0 ~ /Listening on/ { print $7}' my.log)
 done
echo "listening on $url"
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

No branches or pull requests

1 participant