Merge pull request #1454 from badsyntax/enable_http_proxy

grpc-js: Add support for grpc.enable_http_proxy channel option
This commit is contained in:
Michael Lumish 2020-06-01 13:54:39 -07:00 committed by GitHub
commit 136626aaca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 0 deletions

View File

@ -43,5 +43,6 @@ In addition, all channel arguments defined in [this header file](https://github.
- `grpc.use_local_subchannel_pool`
- `grpc.max_send_message_length`
- `grpc.max_receive_message_length`
- `grpc.enable_http_proxy`
- `channelOverride`
- `channelFactoryOverride`

View File

@ -32,6 +32,7 @@ export interface ChannelOptions {
'grpc.use_local_subchannel_pool'?: number;
'grpc.max_send_message_length'?: number;
'grpc.max_receive_message_length'?: number;
'grpc.enable_http_proxy'?: number;
[key: string]: string | number | undefined;
}
@ -53,6 +54,7 @@ export const recognizedOptions = {
'grpc.use_local_subchannel_pool': true,
'grpc.max_send_message_length': true,
'grpc.max_receive_message_length': true,
'grpc.enable_http_proxy': true,
};
export function channelOptionsEqual(

View File

@ -125,6 +125,9 @@ export function mapProxyName(
target: target,
extraOptions: {},
};
if ((options['grpc.enable_http_proxy'] ?? 1) === 0) {
return noProxyResult;
}
const proxyInfo = getProxyInfo();
if (!proxyInfo.address) {
return noProxyResult;