Skip to content

Fix SseServerWrapper to support port 0 (OS auto-assign)#38

Open
x9090 wants to merge 2 commits into0xeb:mainfrom
x9090:main
Open

Fix SseServerWrapper to support port 0 (OS auto-assign)#38
x9090 wants to merge 2 commits into0xeb:mainfrom
x9090:main

Conversation

@x9090
Copy link

@x9090 x9090 commented Mar 10, 2026

Use bind_to_any_port()/bind_to_port() synchronously in start() so the actual assigned port is stored in port_ before the listen thread starts. run_server() now calls listen_after_bind() instead of listen().

x9090 added 2 commits March 10, 2026 13:21
Use bind_to_any_port()/bind_to_port() synchronously in start() so the
actual assigned port is stored in port_ before the listen thread starts.
run_server() now calls listen_after_bind() instead of listen().
@polaon
Copy link

polaon commented Mar 10, 2026

Hello @x9090, I created a similar PR: #37 which uses similar logic and also adds support for using port 0 in all HTTP servers (HTTP-only, HTTP SSE, Streamable HTTP) in this repository.

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