mirror of https://github.com/grpc/grpc-node.git
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:
commit
136626aaca
|
@ -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`
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue