var/const updates

This commit is contained in:
Steve-Mcl
2024-03-17 12:37:42 +00:00
parent f61971bc23
commit c368bfea3f
2 changed files with 7 additions and 14 deletions

View File

@@ -515,20 +515,13 @@ in your Node-RED user directory (${RED.settings.userDir}).
opts.headers['user-agent'] = 'Mozilla/5.0 (Node-RED)';
}
if (proxyUrl) {
var match = proxyUrl.match(/^(https?:\/\/)?(.+)?:([0-9]+)?/i);
const match = proxyUrl.match(/^(https?:\/\/)?(.+)?:([0-9]+)?/i);
if (match) {
const proxyURL = parseUrl(proxyUrl)
//set username/password to null to stop empty creds header
/** @type {HttpProxyAgentOptions} */
/** @type {import('hpagent').HttpProxyAgentOptions} */
let proxyOptions = {
proxy: proxyUrl,
// proxy: {
// protocol: proxyURL.protocol,
// hostname: proxyURL.hostname,
// port: proxyURL.port,
// username: null,
// password: null
// },
scheduling: 'lifo',
maxFreeSockets: 256,
maxSockets: 256,
@@ -554,7 +547,7 @@ in your Node-RED user directory (${RED.settings.userDir}).
};
} else {
node.warn("Bad proxy url: "+ proxyUrl);
node.warn("Bad proxy url: " + proxyUrl);
}
}
if (tlsNode) {