File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ Add the following in `browserstack.json`
142142``` json
143143...
144144"proxy" : {
145- "host " : " localhost" ,
145+ "hostname " : " localhost" ,
146146 "port" : 3128 ,
147147 "username" : " foo" ,
148148 "password" : " bar"
Original file line number Diff line number Diff line change @@ -14,13 +14,16 @@ var Log = require('../lib/logger'),
1414 utils = require ( '../lib/utils' ) ,
1515 Server = require ( '../lib/server' ) . Server ,
1616 Tunnel = require ( '../lib/local' ) . Tunnel ,
17+ tunnel = require ( 'tunnel' ) ,
18+ http = require ( 'http' ) ,
1719 ConfigParser = require ( '../lib/configParser' ) . ConfigParser ,
1820 serverPort = 8888 ,
1921 timeout ,
2022 activityTimeout ,
2123 workers = { } ,
2224 workerKeys = { } ,
2325 logLevel ,
26+ tunnelingAgent ,
2427 tunnel ;
2528
2629function cleanUp ( signal ) {
@@ -214,6 +217,17 @@ var statusPoller = {
214217} ;
215218
216219function runTests ( ) {
220+ if ( config . proxy ) {
221+ console . log ( config . proxy ) ;
222+ tunnelingAgent = tunnel . httpOverHttp ( {
223+ proxy : config . proxy ;
224+ } ) ;
225+ var oldhttpreq = http . request ;
226+ http . request = function ( options , callback ) {
227+ options . agent = tunnelingAgent ;
228+ return oldhttpreq . call ( null , options , callback ) ;
229+ } ;
230+ }
217231 if ( config . browsers && config . browsers . length > 0 ) {
218232 ConfigParser . parse ( client , config . browsers , function ( browsers ) {
219233 launchServer ( ) ;
Original file line number Diff line number Diff line change 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 {
You can’t perform that action at this time.
0 commit comments