diff --git a/src/BrowserStackTunnel.ts b/src/BrowserStackTunnel.ts index 8f76a12..04a0986 100644 --- a/src/BrowserStackTunnel.ts +++ b/src/BrowserStackTunnel.ts @@ -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); diff --git a/src/Tunnel.ts b/src/Tunnel.ts index a129d95..f61736a 100644 --- a/src/Tunnel.ts +++ b/src/Tunnel.ts @@ -103,6 +103,15 @@ export default class Tunnel extends Evented */ 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; @@ -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;