Skip to content

Conversation

szabgab
Copy link
Contributor

@szabgab szabgab commented Apr 2, 2025

Closes #2599

Manually tested on Linux.

@rustbot rustbot added the S-waiting-on-review Status: waiting on a review label Apr 2, 2025
Comment on lines +57 to +63
let mut address = format!("{hostname}:{port}");

if port == "0" {
let listener = std::net::TcpListener::bind(address).unwrap();
let port = listener.local_addr().unwrap().port();
address = format!("{hostname}:{port}");
}
Copy link
Member

Choose a reason for hiding this comment

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

Why not doing this when starting the server?

@ehuss ehuss added S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. and removed S-waiting-on-review Status: waiting on a review labels Apr 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot use serve --open with --port 0
4 participants