feat: add HOST config to control which network interface ld-relay binds to #354
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.
Requirements
Related issues
#353
Describe the solution you've provided
By default, the existing behavior is preserved of binding all to network interfaces. However, if the config HOST is provided, ld-relay will attempt to bind that host on given PORT.
Describe alternatives you've considered
We could offer a boolean flag "BIND_LOCALHOST" or similar that would explicitly set the bind address to
localhost:PORT
. The provided option seemed more inline what I've seen in other projects, but I've no strong personal preference for either.ALternatively we could allow users to specify a fully formed bind address including port and hostname in a single string. I don't like that option because we'd potentially break how folks configure how they instruct ld-relay where to run if they tried to provide both a fully formed address and a port. Keeping HOST and PORT distinct seems simpler to implement and reason about AFAICT.
Additional context
I'm not sure what this new config should be called 🤔