Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow independent proxy url configuration for the browserstack binary #69

Merged
merged 1 commit into from
Nov 12, 2018
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
7 changes: 4 additions & 3 deletions src/BrowserStackTunnel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,11 @@ export default class BrowserStackTunnel extends Tunnel
this.skipServerValidation && args.push('-skipCheck');
this.tunnelId && args.push('-localIdentifier', this.tunnelId);
this.verbose && args.push('-v');
const aProxy =
this.tunnelProxy !== undefined ? this.tunnelProxy : this.proxy;

if (this.proxy) {
const proxy = parseUrl(this.proxy);

if (aProxy) {
const proxy = parseUrl(aProxy);
proxy.hostname && args.push('-proxyHost', proxy.hostname);
proxy.port && args.push('-proxyPort', proxy.port);

Expand Down
12 changes: 12 additions & 0 deletions src/Tunnel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,15 @@ export default class Tunnel extends Evented<TunnelEvents, string>
*/
proxy: string | undefined;

/**
* The URL of a proxy server for the tunnel to go through. Only the
* hostname, port, and auth are used.
*
* This overrides the `proxy` configuration allowing independent
* configuration for the Tunnel binary process only.
*/
tunnelProxy!: string | undefined;

/** A unique identifier for the newly created tunnel. */
tunnelId: string | undefined;

Expand Down Expand Up @@ -743,6 +752,9 @@ export interface TunnelProperties extends DownloadProperties {
/** [[Tunnel.Tunnel.protocol|More info]] */
protocol: string;

/** [[Tunnel.Tunnel.tunnelProxy|More info]] */
tunnelProxy: string | undefined;

/** [[Tunnel.Tunnel.tunnelId|More info]] */
tunnelId: string | undefined;

Expand Down