EightPointsGuzzleBundle icon indicating copy to clipboard operation
EightPointsGuzzleBundle copied to clipboard

Inconsistancy with guzzle when it comes to proxy option

Open fliespl opened this issue 1 year ago • 0 comments

Q A
Symfony version 6/7
Bundle version 8x

In file: https://github.com/8p/EightPointsGuzzleBundle/blob/v8.5.1/src/DependencyInjection/Configuration.php

There is proxy configuration which takes string or arrays. When string is given, it's converted to array in format: [http => IP] (meaning only http requests get proxies).

                            ->arrayNode('proxy')
                                ->beforeNormalization()
                                ->ifString()
                                    ->then(function($v) { return ['http'=> $v]; })
                                ->end()

In guzzle ( https://docs.guzzlephp.org/en/stable/request-options.html#proxy ) passing proxy as string makes it work for all protocols:

Pass a string to specify a proxy for all protocols.

$client->request('GET', '/', ['proxy' => 'http://localhost:8125']);

fliespl avatar Nov 20 '24 14:11 fliespl