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

chore(blockingproxy): Allow using a pre-existing Blocking Proxy instance #3970

Merged
merged 2 commits into from
Jan 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ let allowedNames = [
'seleniumSessionId',
'webDriverProxy',
'useBlockingProxy',
'blockingProxyUrl',
'sauceUser',
'sauceKey',
'sauceAgent',
Expand Down
6 changes: 6 additions & 0 deletions lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ export interface Config {
*/
useBlockingProxy?: boolean;

/**
* If specified, Protractor will connect to the Blocking Proxy at the given
* url instead of starting it's own.
*/
blockingProxyUrl?: string;

// ---- 3. To use remote browsers via Sauce Labs -----------------------------

/**
Expand Down
5 changes: 4 additions & 1 deletion lib/driverProviders/driverProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export abstract class DriverProvider {
}

getBPUrl() {
if (this.config_.blockingProxyUrl) {
return this.config_.blockingProxyUrl;
}
return `http://localhost:${this.bpRunner.port}`;
}

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