mirror of
https://github.com/grpc/grpc-node.git
synced 2025-12-08 18:23:54 +00:00
Merge pull request #1555 from wkchee/patch-1
Fixed connectivity to Google PubSub over proxy
This commit is contained in:
commit
4b9da2ef7b
@ -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?.host ?? targetPath;
|
||||
|
||||
const cts = tls.connect(
|
||||
{
|
||||
host: remoteHost,
|
||||
|
||||
@ -467,11 +467,13 @@ export class Subchannel {
|
||||
* if a connection is successfully established through the proxy.
|
||||
* If the proxy is not used, these connectionOptions are discarded
|
||||
* anyway */
|
||||
connectionOptions.servername = getDefaultAuthority(
|
||||
const targetPath = getDefaultAuthority(
|
||||
parseUri(this.options['grpc.http_connect_target'] as string) ?? {
|
||||
path: 'localhost',
|
||||
}
|
||||
);
|
||||
const hostPort = splitHostPort(targetPath);
|
||||
connectionOptions.servername = hostPort?.host ?? targetPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user