Update http_proxy.ts

This commit is contained in:
WK 2020-08-30 14:49:54 +08:00 committed by GitHub
parent c536178c67
commit 6f3db6f4d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -215,8 +215,10 @@ export function getProxiedConnection(
* connection to a TLS connection.
* This is a workaround for https://github.com/nodejs/node/issues/32922
* See https://github.com/grpc/grpc-node/pull/1369 for more info. */
const remoteHost = getDefaultAuthority(parsedTarget);
const targetPath = getDefaultAuthority(parsedTarget);
const hostPort = splitHostPort(targetPath);
const remoteHost = (hostPort !== null) ? hostPort.host : targetPath;
const cts = tls.connect(
{
host: remoteHost,