File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ export interface ChannelOptions {
3636 'grpc.max_send_message_length' ?: number ;
3737 'grpc.max_receive_message_length' ?: number ;
3838 'grpc.enable_http_proxy' ?: number ;
39+ 'grpc.http_proxy' ?: string ;
3940 /* http_connect_target and http_connect_creds are used for passing data
4041 * around internally, and should not be documented as public-facing options
4142 */
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ interface ProxyInfo {
4141 creds ?: string ;
4242}
4343
44- function getProxyInfo ( ) : ProxyInfo {
44+ function getProxyInfo ( proxy ?: string ) : ProxyInfo {
4545 let proxyEnv = '' ;
4646 let envVar = '' ;
4747 /* Prefer using 'grpc_proxy'. Fallback on 'http_proxy' if it is not set.
@@ -57,6 +57,9 @@ function getProxyInfo(): ProxyInfo {
5757 } else if ( process . env . http_proxy ) {
5858 envVar = 'http_proxy' ;
5959 proxyEnv = process . env . http_proxy ;
60+ } else if ( proxy ) {
61+ envVar = 'proxy' ;
62+ proxyEnv = proxy
6063 } else {
6164 return { } ;
6265 }
@@ -190,7 +193,7 @@ export function mapProxyName(
190193 if ( target . scheme === 'unix' ) {
191194 return noProxyResult ;
192195 }
193- const proxyInfo = getProxyInfo ( ) ;
196+ const proxyInfo = getProxyInfo ( options [ 'grpc.http_proxy' ] ) ;
194197 if ( ! proxyInfo . address ) {
195198 return noProxyResult ;
196199 }
You can’t perform that action at this time.
0 commit comments