hertz-examples icon indicating copy to clipboard operation
hertz-examples copied to clipboard

set so_reuseaddr for client in reverse proxy mode so uses 1 connection to interface with server.

Open ouvaa opened this issue 1 year ago • 3 comments

set so_reuseaddr for client in reverse proxy mode so uses 1 connection to interface with server.

the server side will save on fd with 1 connection

ouvaa avatar Mar 21 '24 21:03 ouvaa

if there's already an example, pls provide it. thx

ouvaa avatar Mar 21 '24 21:03 ouvaa

Isn't this the keep alive feature of HTTP1?

li-jin-gou avatar Mar 22 '24 15:03 li-jin-gou

@li-jin-gou no, it's running multiple client processes in one port.

https://blog.cloudflare.com/how-to-stop-running-out-of-ephemeral-ports-and-start-to-love-long-lived-connections

can you please provide the code example for using so_reuseaddr as a proxy as the client connecting to backend? will be running multiple processes to tie the client to single port

ouvaa avatar Mar 23 '24 03:03 ouvaa