grpc-js: initiate tls connection through http proxy

This commit is contained in:
Tom Kirkpatrick 2020-04-18 11:04:13 +02:00
parent 03fdeedc78
commit af7f4f798d
No known key found for this signature in database
GPG Key ID: 72203A8EC5967EA8
1 changed files with 9 additions and 3 deletions

View File

@ -21,6 +21,7 @@ import { LogVerbosity } from './constants';
import { parseTarget } from './resolver-dns';
import { Socket } from 'net';
import * as http from 'http';
import * as tls from 'tls'
import * as logging from './logging';
import {
SubchannelAddress,
@ -202,9 +203,14 @@ export function getProxiedConnection(
' through proxy ' +
proxyAddressString
);
resolve({
socket,
realTarget,
var cts = tls.connect({
host: options.host,
socket: socket
}, function () {
resolve({
socket: cts,
realTarget,
});
});
} else {
log(