kev
kev

Reputation: 161674

How to disable proxy setting in phantomjs?

I can set proxy in script:

phantom.setProxy('192.168.1.42', 8080, 'http', 'user', 'passwd');

But how can I disable previous proxy in script without restarting phantomjs.

I want to write a phantomjs rendering service which accept a proxy argument (optional) for every request.

Upvotes: 2

Views: 1226

Answers (1)

Vaviloff
Vaviloff

Reputation: 16838

Only just recently discovered setProxy() and have been experimenting with it, so I'd share that yes, doing

phantom.setProxy("");

does reset proxy in PhantomJS, even after some pages have been opened.

Upvotes: 1

Related Questions