Merge pull request #803 from beenanner/add-proxy-to-screenshot-options

WIP: Add ability to use proxy configuration for screenshots
This commit is contained in:
Peter Hedenskog 2016-01-23 20:42:32 +01:00
commit eada5ea329
1 changed files with 7 additions and 0 deletions

View File

@ -11,6 +11,7 @@ var path = require('path'),
phantomPath = require('phantomjs').path,
slimerPath = require('slimerjs').path,
util = require('../util/util'),
urlParser = require('url'),
inspect = require('util').inspect,
fs = require('fs'),
winston = require('winston'),
@ -98,6 +99,12 @@ function screenshot(args, asyncDoneCallback) {
} else {
childArgs.push('false');
}
if (config.proxy) {
var pUrl = urlParser.parse(config.proxy);
childArgs.push('--proxy=' + pUrl.hostname + ':' + pUrl.port)
}
childArgs.push(config.waitScript);
return childArgs;
}