Any suggestions on how to enforce a maximum durati...
# http4k
j
Any suggestions on how to enforce a maximum duration on an incoming connection? ie. I want to issue a
Connection: close
after a connection has been used for over 1 minute.
s
That’s done at the level of the server backend you’ve chosen to use (jetty, undertow, etc). We don’t control network level configuration via our API, but can try pointing you to the right docs if you let us know which backend you’re using.
j
Thanks. We are using undertow.
s
@Jordan Terrell we currently don't have a way to configure the underlying Undertow out-of-the-box. However, the core of our undertow integration is ~20 LOC, so you can easily replace with a custom implementation. I've put together a full example of how I'd put together a CustomUndertow server to cover your needs: https://gist.github.com/s4nchez/7f308483ac2402d9d429ff2b319b5b24 I hope that helps, otherwise please shout!
j
Thanks. I'll look into that.
If I find something, I'll post it here.
👍 1