launchdarkly / ld-relay

LaunchDarkly Relay Proxy
Other
111 stars 80 forks source link

feat: add HOST config to control which network interface ld-relay binds to #354

Open brycefisher opened 6 months ago

brycefisher commented 6 months ago

Requirements

Related issues

https://github.com/launchdarkly/ld-relay/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 šŸ¤”

brycefisher commented 6 months ago

@cwaldren-ld is there anything special I need to do to run the existing tests? Is go test good enough to iterate locally? Apologies for missing the contribution guide! Feel free to point me at that.

cwaldren-ld commented 6 months ago

Hi @brycefisher , the guide is here: https://github.com/launchdarkly/ld-relay/blob/v8/CONTRIBUTING.md