Skip to content

Commit 136626a

Browse files
authored
Merge pull request #1454 from badsyntax/enable_http_proxy
grpc-js: Add support for grpc.enable_http_proxy channel option
2 parents f309912 + f7a749d commit 136626a

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

PACKAGE-COMPARISON.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,6 @@ In addition, all channel arguments defined in [this header file](https://github.
4343
- `grpc.use_local_subchannel_pool`
4444
- `grpc.max_send_message_length`
4545
- `grpc.max_receive_message_length`
46+
- `grpc.enable_http_proxy`
4647
- `channelOverride`
4748
- `channelFactoryOverride`

packages/grpc-js/src/channel-options.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export interface ChannelOptions {
3232
'grpc.use_local_subchannel_pool'?: number;
3333
'grpc.max_send_message_length'?: number;
3434
'grpc.max_receive_message_length'?: number;
35+
'grpc.enable_http_proxy'?: number;
3536
[key: string]: string | number | undefined;
3637
}
3738

@@ -53,6 +54,7 @@ export const recognizedOptions = {
5354
'grpc.use_local_subchannel_pool': true,
5455
'grpc.max_send_message_length': true,
5556
'grpc.max_receive_message_length': true,
57+
'grpc.enable_http_proxy': true,
5658
};
5759

5860
export function channelOptionsEqual(

packages/grpc-js/src/http_proxy.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ export function mapProxyName(
125125
target: target,
126126
extraOptions: {},
127127
};
128+
if ((options['grpc.enable_http_proxy'] ?? 1) === 0) {
129+
return noProxyResult;
130+
}
128131
const proxyInfo = getProxyInfo();
129132
if (!proxyInfo.address) {
130133
return noProxyResult;

0 commit comments

Comments
 (0)