Skip to content

feat: use fallback server bind address#378

Merged
rochacbruno merged 1 commit intorochacbruno:mainfrom
guibeira:feat/random-port
Oct 21, 2025
Merged

feat: use fallback server bind address#378
rochacbruno merged 1 commit intorochacbruno:mainfrom
guibeira:feat/random-port

Conversation

@guibeira
Copy link
Copy Markdown
Contributor

This pull request improves the server startup logic in src/server.rs by introducing a fallback mechanism when binding to the requested address fails. The server will now attempt to bind to an OS-assigned port if the initial address is unavailable, and updates the logging to reflect the actual address and port in use.

Server startup robustness:

  • Added FALLBACK_BIND_ADDRESS constant (0.0.0.0:0) to allow the OS to assign an available port if the requested address cannot be bound.
  • Modified the startup logic in start to attempt binding to the fallback address when the initial attempt fails, and log a warning with error details.

Improved logging:

  • Updated log messages to display the actual address and port the server is listening on, including for live reload WebSocket and HTTP server URLs.

@rochacbruno
Copy link
Copy Markdown
Owner

TIL: 0.0.0.0:0 💯

@rochacbruno rochacbruno merged commit b8fb457 into rochacbruno:main Oct 21, 2025
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants