diff --git a/lib/Local.js b/lib/Local.js index 65d7c1a..eb7c196 100644 --- a/lib/Local.js +++ b/lib/Local.js @@ -142,6 +142,11 @@ function Local(){ this.proxyPass = '-proxyPass ' + value; break; + case 'forceproxy': + if(value) + this.forceProxyFlag = '-forceproxy'; + break; + case 'hosts': if(value) this.hosts = value; @@ -195,6 +200,8 @@ function Local(){ args.push(this.proxyUser); if(this.proxyPass) args.push(this.proxyPass); + if(this.forceProxyFlag) + args.push(this.forceProxyFlag); if(this.forceFlag) args.push(this.forceFlag); if(this.verboseFlag) diff --git a/test/local.js b/test/local.js index cb5be3d..77755d0 100644 --- a/test/local.js +++ b/test/local.js @@ -86,6 +86,14 @@ describe('Local', function () { }); }); + it('should enable forceproxy', function (done) { + bsLocal.start({ key: process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, forceproxy: true }, function(){ + expect(bsLocal.getBinaryArgs().indexOf('-forceproxy')).to.not.equal(-1); + done(); + }); + }); + + it('should set localIdentifier', function (done) { bsLocal.start({ key: process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, localIdentifier: 'abcdef' }, function(){ expect(bsLocal.getBinaryArgs().indexOf('-localIdentifier abcdef')).to.not.equal(-1);