valyala / fasthttp

Fast HTTP package for Go. Tuned for high performance. Zero memory allocations in hot paths. Up to 10x faster than net/http
MIT License
21.91k stars 1.76k forks source link

Question regarding TCPDialer and KeepAlive #1667

Open qpbd86 opened 1 year ago

qpbd86 commented 1 year ago

Is doesn't look there is a way to pass KeepAlive configuration (ref) to the underlying net.Dialer used by TCPDialer here. A simple approach might be to add another public field to the TCPDialer struct here, is that something that could be supported? I have a use-case that requires a shorter interval than the default, and it would be great to use the TCPDialer for it. Happy to contribute an implementation if it's welcome!

erikdubbelboer commented 1 year ago

I'm open to a pull request that adds an extra field for this.