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

Cosmin Victor Celea

08/05/2021, 6:17 PM
Hi, is there a way to configure timeouts for requests?
d

dave

08/05/2021, 6:40 PM
for outgoing you can just configure the client. for incoming it's something I've actually never seen done before TBH..
c

Cosmin Victor Celea

08/05/2021, 6:42 PM
For incoming, we wrote our own throttling logic, and we had a pentester testing the app, and we discovered the throttling breaks because of hanging requests.
d

dave

08/05/2021, 6:43 PM
can you reuse something from resilience4k maybe?
c

Cosmin Victor Celea

08/05/2021, 6:43 PM
will check
j

James Richardson

08/06/2021, 7:38 AM
You might consider a proxy in front of the jvm to deal with stuff like that. Varnish and others can help mitigate slow loris type attacks.
f

Fantayeneh

08/09/2021, 2:58 PM
I think for undertow the idle timeout is already exposed.
<http://UndertowOptions.NO|UndertowOptions.NO>_REQUEST_TIMEOUT
It can also be don for netty server if we add the ReadTimeoutHandler in the server pipeline
c

Cosmin Victor Celea

08/12/2021, 2:18 PM
does not seem to work for undertow
the request still stays open
even after the configured time has passed
I actually found a solution using withTimeoutOrNull inside a filter that wraps the request. Bad idea @dave ?
2 Views