uWebSockets.js icon indicating copy to clipboard operation
uWebSockets.js copied to clipboard

How to configure keep-alive for uWs.App()?

Open lwq057 opened this issue 1 year ago • 7 comments

I looked in the documentation, but couldn't seem to find any relevant configuration.

Is keep-alive enabled by default? What are the parameters?

uWs.App()
.get('/',(res, req)=>{
res.end('ok');
})
.listen(8080, (token) => {});

lwq057 avatar Jul 17 '24 03:07 lwq057

I want to set keep-alive to 30s or 60s, how can I do it?

lwq057 avatar Jul 17 '24 03:07 lwq057

It is 10s hardcoded. I think? Maybe we made it an environment variable. If not, could be time to make it so. But very few people have asked for this

uNetworkingAB avatar Jul 18 '24 16:07 uNetworkingAB

It is 10s hardcoded. I think? Maybe we made it an environment variable. If not, could be time to make it so. But very few people have asked for this

This will make uWebSockets.js more performant. Configure keep-alive to optimize network performance and reduce TCP connection times in different applications. Usually when using a reverse proxy.

lwq057 avatar Jul 18 '24 17:07 lwq057

I like your sales pitch ✅

uNetworkingAB avatar Jul 18 '24 17:07 uNetworkingAB

This would be a great addition and will add value to backends where applications are behind reverse proxy, which mostly are.

ezioda004 avatar Jul 23 '24 19:07 ezioda004

Hey @uNetworkingAB, I liked this idea as well, will you be adding this?

Dhruv-Garg79 avatar Oct 01 '24 08:10 Dhruv-Garg79

Any news on this?

7iomka avatar Oct 17 '24 20:10 7iomka