2 var page = require('webpage').create(),
3 system = require('system'),
6 if (system.args.length < 4) {
7 console.log('Usage: openurlwithproxy.js <proxyHost> <proxyPort> <URL>');
10 host = system.args[1];
11 port = system.args[2];
12 address = system.args[3];
13 phantom.setProxy(host, port, 'manual', '', '');
14 page.open(address, function (status) {
15 if (status !== 'success') {
16 console.log('FAIL to load the address "' +
17 address + '" using proxy "' + host + ':' + port + '"');
19 console.log('Page title is ' + page.evaluate(function () {
20 return document.title;