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.94k stars 1.76k forks source link

Merge the various proxy dialer implementations from the fasthttpproxy into a single struct. #1829

Closed newacorn closed 3 months ago

newacorn commented 3 months ago

https://github.com/valyala/fasthttp/issues/1822 In this issue, I noticed that the existing implementation doesn't leverage fasthttp's dialer mechanism, so I created this pull request. At the same time, provide more comprehensive support for proxy environment variables and allow configuration of the fasthttp dialer. No tests were committed, and the logic is built on top of the existing fasthttpproxy foundation. I noticed that the original fasthttpproxy also didn't include any test code. The proxy address is not universal, but I did some local debugging and didn't find any issues.

newacorn commented 3 months ago

I like it. I think it makes the old method obsolete, but we can't remove them for backwards compatibility of course. So I think we should rewrite the old methods to use this new Dialer instead. What do you think?

You are correct;I agree with your point. I forgot about backward compatibility and deduplication. Next, I will try to rewrite the existing functions.

erikdubbelboer commented 3 months ago

Thanks!