Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistancy with guzzle when it comes to proxy option #343

Open
fliespl opened this issue Nov 20, 2024 · 0 comments
Open

Inconsistancy with guzzle when it comes to proxy option #343

fliespl opened this issue Nov 20, 2024 · 0 comments

Comments

@fliespl
Copy link

fliespl commented Nov 20, 2024

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']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant