Skip to content

Commit

Permalink
Allow independent proxy url configuration for the browserstack binary
Browse files Browse the repository at this point in the history
This commit refers to issue #16
  • Loading branch information
lbod authored and jason0x43 committed Nov 12, 2018
1 parent 0e0671b commit f504f84
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
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

0 comments on commit f504f84

Please sign in to comment.