Merge branch 'master' into grpc-js_max_message_size

This commit is contained in:
Michael Lumish 2020-04-09 16:29:26 -07:00 committed by GitHub
commit 51ce6a3ef2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -58,7 +58,7 @@ function getProxyInfo(): ProxyInfo {
try { try {
proxyUrl = new URL(proxyEnv); proxyUrl = new URL(proxyEnv);
} catch (e) { } catch (e) {
log(LogVerbosity.INFO, `cannot parse value of "${envVar}" env var`); log(LogVerbosity.ERROR, `cannot parse value of "${envVar}" env var`);
return {}; return {};
} }
if (proxyUrl.protocol !== 'http:') { if (proxyUrl.protocol !== 'http:') {
@ -145,17 +145,17 @@ export function getProxiedConnection(target: string, subchannelAddress: Subchann
request.once('connect', (res, socket, head) => { request.once('connect', (res, socket, head) => {
request.removeAllListeners(); request.removeAllListeners();
socket.removeAllListeners(); socket.removeAllListeners();
if (res.statusCode === http.STATUS_CODES.OK) { if (res.statusCode === 200) {
trace('Successfully connected to ' + subchannelAddress + ' through proxy ' + PROXY_INFO.address); trace('Successfully connected to ' + subchannelAddress + ' through proxy ' + PROXY_INFO.address);
resolve(socket); resolve(socket);
} else { } else {
trace('Failed to connect to ' + subchannelAddress + ' through proxy ' + PROXY_INFO.address); log(LogVerbosity.ERROR, 'Failed to connect to ' + subchannelAddress + ' through proxy ' + PROXY_INFO.address);
reject(); reject();
} }
}); });
request.once('error', (err) => { request.once('error', (err) => {
request.removeAllListeners(); request.removeAllListeners();
trace('Failed to connect to proxy ' + PROXY_INFO.address); log(LogVerbosity.ERROR, 'Failed to connect to proxy ' + PROXY_INFO.address);
reject(); reject();
}); });
}); });