KBS18
KBS18

Reputation: 1

How to set a proxy when creating an instance of phantomjs

I'm trying to create an instance of phantomjs using a proxy...

// require
var phantom = require('webpage');

// create instance
var webpage = phantom.create([`--proxy=proxy-nl.privateinternetaccess.com:1080`, `--proxy-type=socks5`, `--proxy-auth=***:***`]);

// open page
webpage.open('https://whatismyipaddress.com');

compiling with slimerjs

./node_modules/.bin/slimerjs app.js

The page opens, however it appears that my proxy is not being used, since the page shows my own IP.

I've tried a couple different proxies as well, nothing works, and I'm not sure what I'm doing wrong. Any insight is much appreciated!

Upvotes: 0

Views: 70

Answers (0)

Related Questions