Closed tecnobrat closed 3 years ago
Can you please describe the requirement instead? What is is the problem you're running into?
+1. The problem is that a malicious client can open thousands of tcp connections and not send the proxy protocol header. The server will hold those socket descriptors open indefinitely, eventually running out of resources. I'll take a crack at making a pull request.
For your consideration: https://github.com/pires/go-proxyproto/pull/74
Excellent library by the way. I am planning on using this in production.
Thank you @unmarshal!
Sorry I didn't see your question before @pires. My motivation is a little different, but @unmarshal is right on the technical reasoning.
My motivation is that I would like to add proxy v2 support to https://github.com/fabiolb/fabio and they already make use of ProxyHeaderTimeout
, so for me to be able to swap their implementation to this library, I'd need that support.
Not great motivation for this project, but thats my personal motivation!
Hi @tecnobrat, does that mean you would prefer it be called ProxyHeaderTimeout?
@unmarshal I don't think the naming matters, it just means I'll need to do:
ln = &proxyproto.Listener{
Listener: ln,
ReadHeaderTimeout: l.ProxyHeaderTimeout,
}
No big deal :)
Thanks for sharing, @tecnobrat.
This has been addressed by #74.
This library seems to lean heavily on inspiration from https://github.com/armon/go-proxyproto
That library supports passing in a timeout when you define the listener:
It would be nice if the same feature, or a similar feature was possible with this library.