mirror of https://github.com/grpc/grpc-node.git
Set the default port of 80 explicitly in http_proxy
This commit is contained in:
parent
b51afd3852
commit
eb95fa618d
|
@ -84,8 +84,16 @@ function getProxyInfo(): ProxyInfo {
|
||||||
userCred = proxyUrl.username;
|
userCred = proxyUrl.username;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const hostname = proxyUrl.hostname;
|
||||||
|
let port = proxyUrl.port;
|
||||||
|
/* The proxy URL uses the scheme "http:", which has a default port number of
|
||||||
|
* 80. We need to set that explicitly here if it is omitted because otherwise
|
||||||
|
* it will use gRPC's default port 443. */
|
||||||
|
if (port === '') {
|
||||||
|
port = '80';
|
||||||
|
}
|
||||||
const result: ProxyInfo = {
|
const result: ProxyInfo = {
|
||||||
address: proxyUrl.host,
|
address: `${hostname}:${port}`
|
||||||
};
|
};
|
||||||
if (userCred) {
|
if (userCred) {
|
||||||
result.creds = userCred;
|
result.creds = userCred;
|
||||||
|
|
Loading…
Reference in New Issue