Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit 879aac6

Browse files
authored
chore(blockingproxy): Allow using a pre-existing Blocking Proxy instance (#3970)
1 parent bf123ad commit 879aac6

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

lib/cli.ts

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ let allowedNames = [
4141
'seleniumSessionId',
4242
'webDriverProxy',
4343
'useBlockingProxy',
44+
'blockingProxyUrl',
4445
'sauceUser',
4546
'sauceKey',
4647
'sauceAgent',

lib/config.ts

+6
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ export interface Config {
104104
*/
105105
useBlockingProxy?: boolean;
106106

107+
/**
108+
* If specified, Protractor will connect to the Blocking Proxy at the given
109+
* url instead of starting it's own.
110+
*/
111+
blockingProxyUrl?: string;
112+
107113
// ---- 3. To use remote browsers via Sauce Labs -----------------------------
108114

109115
/**

lib/driverProviders/driverProvider.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ export abstract class DriverProvider {
3131
}
3232

3333
getBPUrl() {
34+
if (this.config_.blockingProxyUrl) {
35+
return this.config_.blockingProxyUrl;
36+
}
3437
return `http://localhost:${this.bpRunner.port}`;
3538
}
3639

@@ -105,7 +108,7 @@ export abstract class DriverProvider {
105108
*/
106109
setupEnv(): q.Promise<any> {
107110
let driverPromise = this.setupDriverEnv();
108-
if (this.config_.useBlockingProxy) {
111+
if (this.config_.useBlockingProxy && !this.config_.blockingProxyUrl) {
109112
// TODO(heathkit): If set, pass the webDriverProxy to BP.
110113
return q.all([driverPromise, this.bpRunner.start()]);
111114
}

0 commit comments

Comments
 (0)