kriswallsmith / Buzz

PHP's lightweight HTTP client
MIT License
1.92k stars 250 forks source link

Add support for system proxy in FileGetContents client #397

Open pimterry opened 5 years ago

pimterry commented 5 years ago

Buzz supports proxies when specified explicitly, but generally doesn't use the system-wide default proxy settings (from the http_proxy/HTTP_PROXY environment variables). The curl client does, because curl has this behaviour built-in, but FileGetContents does not because it doesn't.

Most other HTTP libraries and tools (for PHP and elsewhere) support this, and it was mentioned a few years ago when proxy support was originally added, but it looks like that was never implemented: https://github.com/kriswallsmith/Buzz/pull/58#issuecomment-4660663

I'd find it very useful if FileGetContents automatically detected and used the system proxy settings, so the standard example Buzz code worked out of the box on systems with a proxy configured.