From eead8c9ac0e326be3f0ade57f2af1947c6da1853 Mon Sep 17 00:00:00 2001 From: "Lee, Jonathan" Date: Sun, 17 Jan 2016 15:22:03 -0500 Subject: [PATCH 1/2] Add ability to use proxy configuration for screenshots --- lib/analyze/screenshots.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/analyze/screenshots.js b/lib/analyze/screenshots.js index fece343a9..caf47dc76 100644 --- a/lib/analyze/screenshots.js +++ b/lib/analyze/screenshots.js @@ -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 url = urlParser.parse(config.proxy); + childArgs.push('--proxy=' + url.hostname + ':' + url.port) + } + childArgs.push(config.waitScript); return childArgs; } From 1d6d4b342ff44c9f95d54d09592843e5d63f738e Mon Sep 17 00:00:00 2001 From: "Lee, Jonathan" Date: Sun, 17 Jan 2016 15:42:04 -0500 Subject: [PATCH 2/2] Rename variable to not conflict with existing variable url --- lib/analyze/screenshots.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/analyze/screenshots.js b/lib/analyze/screenshots.js index caf47dc76..d05d0a9a0 100644 --- a/lib/analyze/screenshots.js +++ b/lib/analyze/screenshots.js @@ -101,8 +101,8 @@ function screenshot(args, asyncDoneCallback) { } if (config.proxy) { - var url = urlParser.parse(config.proxy); - childArgs.push('--proxy=' + url.hostname + ':' + url.port) + var pUrl = urlParser.parse(config.proxy); + childArgs.push('--proxy=' + pUrl.hostname + ':' + pUrl.port) } childArgs.push(config.waitScript);