how to set so_reuseaddr for rueidis?
ouvaa opened this issue · comments
ouvaa commented
i have multiple rueidis instances clients running per process and connects to multiple redis server backend.
i would like to minimize the ports generated as a redis proxy e.g.:
https://blog.cloudflare.com/how-to-stop-running-out-of-ephemeral-ports-and-start-to-love-long-lived-connections
how to do so_reuseaddr for rueidis with plenty of ruedis client processes running concurrently?
Rueian commented
Hi @ouvaa,
You can do it in the DialFn
function:
rueidis.NewClient(rueidis.ClientOption{
DialFn: func(s string, dialer *net.Dialer, config *tls.Config) (conn net.Conn, err error) {
// return your so_reuseaddr enabled net.Conn here
},
})
ouvaa commented
thx
ouvaa commented
thx