Skip to content

Commit f2c2924

Browse files
committed
Merge pull request #6 from browserstack/force_proxy
force proxy
2 parents c84cc53 + ccc426c commit f2c2924

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

lib/Local.js

+7
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ function Local(){
142142
this.proxyPass = '-proxyPass ' + value;
143143
break;
144144

145+
case 'forceproxy':
146+
if(value)
147+
this.forceProxyFlag = '-forceproxy';
148+
break;
149+
145150
case 'hosts':
146151
if(value)
147152
this.hosts = value;
@@ -195,6 +200,8 @@ function Local(){
195200
args.push(this.proxyUser);
196201
if(this.proxyPass)
197202
args.push(this.proxyPass);
203+
if(this.forceProxyFlag)
204+
args.push(this.forceProxyFlag);
198205
if(this.forceFlag)
199206
args.push(this.forceFlag);
200207
if(this.verboseFlag)

test/local.js

+8
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ describe('Local', function () {
8686
});
8787
});
8888

89+
it('should enable forceproxy', function (done) {
90+
bsLocal.start({ key: process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, forceproxy: true }, function(){
91+
expect(bsLocal.getBinaryArgs().indexOf('-forceproxy')).to.not.equal(-1);
92+
done();
93+
});
94+
});
95+
96+
8997
it('should set localIdentifier', function (done) {
9098
bsLocal.start({ key: process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, localIdentifier: 'abcdef' }, function(){
9199
expect(bsLocal.getBinaryArgs().indexOf('-localIdentifier abcdef')).to.not.equal(-1);

0 commit comments

Comments
 (0)