Skip to content

Instantly share code, notes, and snippets.

@dahngeek
Last active May 24, 2018 12:06
Show Gist options
  • Save dahngeek/752ca52778913705f7204c57f359afb5 to your computer and use it in GitHub Desktop.
Save dahngeek/752ca52778913705f7204c57f359afb5 to your computer and use it in GitHub Desktop.
Running a PhantomJS driver with webdriver.io using an http proxy. Or with authentication.
capabilities: [
{ browserName: 'phantomjs',
"phantomjs.page.settings.userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/601.1.54 (KHTML, like Gecko) Version/9.0 Safari/601.1.54",
"proxy": {
"proxyType":"MANUAL",
"httpProxy":"HOST:PORT"
}
}
]
// OTHER OPTIONS WOULD BE:
// , httpProxy: 'domain.com:port'
// , sslProxy: 'domain.com:port'
// , socksUsername: 'username'
// , socksPassword: '**************'
//OTHER METHOD with AUTH
{ browserName: 'phantomjs',
"phantomjs.page.settings.userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/601.1.54 (KHTML, like Gecko) Version/9.0 Safari/601.1.54",
"phantomjs.cli.args": [
"--proxy-type=http",
"--proxy=HOST:PORT",
"--proxy-auth=username:password"
]
}
//Comment if it was useful!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment