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

fred.deschenes

01/25/2018, 9:06 PM
but I can share the like 4 relevant lines : In an InboundHandler :
Copy code
ctx.channel().attr(KEEP_ALIVE_KEY).set(HttpHeaders.isKeepAlive(req));
In your OutboundHandler :
Copy code
if (ctx.channel().attr(KEEP_ALIVE_KEY).get()) {
            HttpHeaders.setKeepAlive(res, true);

            ctx.writeAndFlush(response);
        } else {
            ctx.writeAndFlush(response).addListener(ChannelFutureListener.CLOSE);
        }