Skip to content

Commit c668d2c

Browse files
committed
Ensure proxy config works with remote clients too
1 parent 4695a5d commit c668d2c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/rules/requests/request-handlers.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,7 @@ interface SerializedPassThroughData {
651651
type: 'passthrough';
652652
forwardToLocation?: string;
653653
forwarding?: ForwardingOptions;
654+
proxyConfig?: ProxyConfig;
654655
ignoreHostCertificateErrors?: string[]; // Doesn't match option name, backward compat
655656
clientCertificateHostMap?: { [host: string]: { pfx: string, passphrase?: string } };
656657
lookupOptions?: PassThroughLookupOptions;
@@ -1501,6 +1502,7 @@ export class PassThroughHandler extends Serializable implements RequestHandler {
15011502
forwardToLocation: this.forwarding.targetHost,
15021503
forwarding: this.forwarding
15031504
} : {},
1505+
proxyConfig: this.proxyConfig,
15041506
lookupOptions: this.lookupOptions,
15051507
ignoreHostCertificateErrors: this.ignoreHostHttpsErrors,
15061508
clientCertificateHostMap: _.mapValues(this.clientCertificateHostMap,
@@ -1604,6 +1606,7 @@ export class PassThroughHandler extends Serializable implements RequestHandler {
16041606
forwarding: { targetHost: data.forwardToLocation }
16051607
} : {},
16061608
forwarding: data.forwarding,
1609+
proxyConfig: data.proxyConfig,
16071610
lookupOptions: data.lookupOptions,
16081611
ignoreHostHttpsErrors: data.ignoreHostCertificateErrors,
16091612
clientCertificateHostMap: _.mapValues(data.clientCertificateHostMap,

src/rules/websockets/websocket-handlers.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ export interface PassThroughWebSocketHandlerOptions {
180180
interface SerializedPassThroughWebSocketData {
181181
type: 'ws-passthrough';
182182
forwarding?: ForwardingOptions;
183+
proxyConfig?: ProxyConfig;
183184
ignoreHostCertificateErrors?: string[]; // Doesn't match option name, backward compat
184185
lookupOptions?: PassThroughLookupOptions;
185186
}
@@ -391,6 +392,7 @@ export class PassThroughWebSocketHandler extends Serializable implements WebSock
391392
return {
392393
type: this.type,
393394
forwarding: this.forwarding,
395+
proxyConfig: this.proxyConfig,
394396
ignoreHostCertificateErrors: this.ignoreHostHttpsErrors,
395397
lookupOptions: this.lookupOptions
396398
};

0 commit comments

Comments
 (0)