K
K
khodos_dmitry2020-12-25 20:05:25
Browsers
khodos_dmitry, 2020-12-25 20:05:25

How to add proxy with username and password in chrome headless?

I create a client like this:

$client = \Symfony\Component\Panther\Client::createChromeClient(null, [
        '--window-size=1200,1100',
        '--proxy-server=http://ip:[email protected]:pass',
        '--headless',
        '--disable-gpu',
    ]);

or like this:
$client = \Symfony\Component\Panther\Client::createChromeClient(null, [
        '--window-size=1200,1100',
        '--proxy-server=http://user:[email protected]:port',
        '--headless',
        '--disable-gpu',
    ]);

And I don't get anything.
Only if so:
$client = \Symfony\Component\Panther\Client::createChromeClient(null, [
        '--window-size=1200,1100',
        '--proxy-server=http://ip:port',
        '--headless',
        '--disable-gpu',
    ]);

But sometimes you need to register a login password for a proxy. How to implement this in chrome or gecko browser? Or is it somehow possible in Symfony/Panther?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question