Add an ip listener option to bind a specific local interface - #191
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add an optional
iplistener option that binds a listener to one local interface instead of all interfaces. Unset keeps today's behavior (bind0.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.Proof: a loopback-bound listener serves a request over
127.0.0.1on both TCP and HTTP/3, and a QUIC socket opened withip => {127,0,0,1}reports that address fromsockname/1.