Skip to content

Add an ip listener option to bind a specific local interface - #191

Merged
williamthome merged 1 commit into
mainfrom
feat/listener-ip-bind-address
Jul 22, 2026
Merged

Add an ip listener option to bind a specific local interface#191
williamthome merged 1 commit into
mainfrom
feat/listener-ip-bind-address

Conversation

@williamthome

Copy link
Copy Markdown
Member

Description

Add an optional ip listener option that binds a listener to one local interface instead of all interfaces. Unset keeps today's behavior (bind 0.0.0.0 / ::); set it to an address such as {127,0,0,1} to restrict the listener to that interface, so a dev, admin, or metrics endpoint can be reachable only from the local host. The option is honored on every socket the listener opens: plain TCP, TLS, and the HTTP/3 UDP socket, including the ephemeral-port probe, so the pinned port is reserved on the bound address rather than on all interfaces.

roadrunner_listener:start_link(my_listener, #{
    port => 8080,
    ip => {127, 0, 0, 1},
    routes => my_handler
}).

Proof: a loopback-bound listener serves a request over 127.0.0.1 on both TCP and HTTP/3, and a QUIC socket opened with ip => {127,0,0,1} reports that address from sockname/1.

@williamthome
williamthome merged commit 319130f into main Jul 22, 2026
15 checks passed
@williamthome
williamthome deleted the feat/listener-ip-bind-address branch July 22, 2026 19:26
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.

1 participant