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

Binding to port 0 (uses a random unused port) works, but does not inform what port it bound to #186

Closed
mickvandijke opened this issue Feb 16, 2023 · 1 comment
Labels
- Developer - Torrust Improvement Experience Bug Incorrect Behavior Code Cleanup / Refactoring Tidying and Making Neat

Comments

@mickvandijke
Copy link
Member

mickvandijke commented Feb 16, 2023

If you bind the [udp_tracker], [http_tracker] or [http_api] to port 0. The OS will bind to a random unused port.

This is to be expected. Torrust however does not inform the user which ports have been bound to.

This is what the console displays:

2023-02-16T12:35:49.246529+01:00 [torrust_tracker::jobs::udp_tracker][INFO] Starting UDP server on: udp://0.0.0.0:0

While the udp server actually bound to port 52862 in my case.

It would be nice to log the actual bound ports in the console.

[PR #156] provides a wrapper struct for the udp server and http api. These wrapper structs also include the bind_address (udp server) for the udp server or http api.

@da2ce7 da2ce7 added Bug Incorrect Behavior Code Cleanup / Refactoring Tidying and Making Neat - Developer - Torrust Improvement Experience and removed Enhancement / Feature Request Something New labels Oct 10, 2023
@josecelano
Copy link
Member

THis is already done:

$ cargo run
   Compiling torrust-tracker v3.0.0-alpha.12-develop (/home/josecelano/Documents/git/committer/me/github/torrust/torrust-tracker)
    Finished dev [optimized + debuginfo] target(s) in 6.65s
     Running `target/debug/torrust-tracker`
Loading default configuration file: `./share/default/config/tracker.development.sqlite3.toml` ...
2024-01-16T15:18:43.683723365+00:00 [torrust_tracker::bootstrap::logging][INFO] logging initialized.
2024-01-16T15:18:43.684290661+00:00 [UDP Tracker][INFO] Starting on: udp://0.0.0.0:45543
2024-01-16T15:18:43.684321071+00:00 [UDP Tracker][INFO] Started on: udp://0.0.0.0:45543
2024-01-16T15:18:43.684333341+00:00 [torrust_tracker::bootstrap::jobs][INFO] TLS not enabled
2024-01-16T15:18:43.684407050+00:00 [HTTP Tracker][INFO] Starting on: http://0.0.0.0:36187
2024-01-16T15:18:43.684422710+00:00 [HTTP Tracker][INFO] Started on: http://0.0.0.0:36187
2024-01-16T15:18:43.684431050+00:00 [torrust_tracker::bootstrap::jobs][INFO] TLS not enabled
2024-01-16T15:18:43.684474960+00:00 [API][INFO] Starting on http://127.0.0.1:39717
2024-01-16T15:18:43.684476930+00:00 [API][INFO] Started on http://127.0.0.1:39717
2024-01-16T15:18:43.684488+00:00 [Health Check API][INFO] Starting on: http://127.0.0.1:1313
2024-01-16T15:18:43.684513890+00:00 [Health Check API][INFO] Started on: http://127.0.0.1:1313

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- Developer - Torrust Improvement Experience Bug Incorrect Behavior Code Cleanup / Refactoring Tidying and Making Neat
Projects
Status: Done
Development

No branches or pull requests

3 participants