https://kotlinlang.org logo
#http4k
Title
# http4k
d

Dan T

03/21/2022, 3:45 PM
Question/request about the listener IP address for Undertow: I see this PR was rejected: https://github.com/http4k/http4k/pull/649 I have a similar use case that seems pretty common and critical from a security perspective: We use a security sidecar pattern on the host that forwards requests to our HTT4K server including authorization headers. I can't have the server listen on
0.0.0.0
, and I don't see a way to modify the configuration using the ServerConfig object. So the only option I'm aware of currently is to create my own class similar to Undertow. Before I do that, I thought I'd double-check in case I'm missing something or this use case changes the perspective. Thanks.
I'm happy to issue another PR to allow an override to the listen IP if that matters.
d

dave

03/21/2022, 5:04 PM
Thanks - but we won't accept it 🙂 - the rationale hasn't changed. As per the below link:
Copy code
Each of the server backends implement an interface ServerConfig, which is written with sensible defaults for the server in questions, but is also designed to be used as a starting point for tweaking to API user needs. To customize, simply use the relevant ServerConfig class as a starting point and reimplement as required. See the how-to guides for an example of this in use.
https://www.http4k.org/guide/reference/servers/#customisation
Basically we don't want to try and build some type of DSL over the server API - it would just be much more work for us to have to maintain so we sidestep the problem entirely.
d

Dan T

03/21/2022, 5:33 PM
👍 thanks David
31 Views