Skip to content

Commit 9ce79e9

Browse files
committed
Merge remote-tracking branch 'origin/master' into testing
2 parents 23e9394 + bc61af4 commit 9ce79e9

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

bin/cli.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,16 @@ var Log = require('../lib/logger'),
1919
utils = require('../lib/utils'),
2020
Server = require('../lib/server').Server,
2121
Tunnel = require('../lib/local').Tunnel,
22+
tunnel = require('tunnel'),
23+
http = require('http'),
2224
ConfigParser = require('../lib/configParser').ConfigParser,
2325
serverPort = 8888,
2426
timeout,
2527
activityTimeout,
2628
workers = {},
2729
workerKeys = {},
2830
logLevel,
31+
tunnelingAgent,
2932
tunnel;
3033

3134
function terminateAllWorkers(callback) {
@@ -253,6 +256,16 @@ var statusPoller = {
253256
};
254257

255258
function runTests() {
259+
if (config.proxy) {
260+
tunnelingAgent = tunnel.httpOverHttp({
261+
proxy: config.proxy
262+
});
263+
var oldhttpreq = http.request;
264+
http.request = function (options, callback) {
265+
options.agent = tunnelingAgent;
266+
return oldhttpreq.call(null, options, callback);
267+
};
268+
}
256269
if (config.browsers && config.browsers.length > 0) {
257270
ConfigParser.parse(client, config.browsers, function(browsers){
258271
launchServer();

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
},
1010
"dependencies": {
1111
"browserstack": "1.0.1",
12-
"chalk": "0.4.0"
12+
"chalk": "0.4.0",
13+
"tunnel": "0.0.3"
1314
},
1415
"licenses": [
1516
{

0 commit comments

Comments
 (0)