Support Happy Eyeballs in proxy-agent

This commit is contained in:
Fedor Indutny 2023-08-30 01:58:48 +02:00 committed by GitHub
parent eae9e570fc
commit 56ba8fea4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 419 additions and 289 deletions

View file

@ -0,0 +1,12 @@
diff --git a/node_modules/proxy-agent/dist/index.js b/node_modules/proxy-agent/dist/index.js
index 885d22a..2930652 100644
--- a/node_modules/proxy-agent/dist/index.js
+++ b/node_modules/proxy-agent/dist/index.js
@@ -29,6 +29,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.ProxyAgent = exports.proxies = void 0;
const http = __importStar(require("http"));
const https = __importStar(require("https"));
+const { URL } = __importStar(require("url"));
const lru_cache_1 = __importDefault(require("lru-cache"));
const agent_base_1 = require("agent-base");
const debug_1 = __importDefault(require("debug"));

View file

@ -0,0 +1,22 @@
diff --git a/node_modules/socks-proxy-agent/dist/index.js b/node_modules/socks-proxy-agent/dist/index.js
index 8189e01..e2dedf8 100644
--- a/node_modules/socks-proxy-agent/dist/index.js
+++ b/node_modules/socks-proxy-agent/dist/index.js
@@ -33,6 +33,7 @@ const debug_1 = __importDefault(require("debug"));
const dns = __importStar(require("dns"));
const net = __importStar(require("net"));
const tls = __importStar(require("tls"));
+const { URL } = __importStar(require("url"));
const debug = (0, debug_1.default)('socks-proxy-agent');
function parseSocksURL(url) {
let lookup = false;
@@ -127,6 +128,9 @@ class SocksProxyAgent extends agent_base_1.Agent {
},
command: 'connect',
timeout: timeout ?? undefined,
+ socket_options: {
+ lookup: lookupFn,
+ },
};
const cleanup = (tlsSocket) => {
req.destroy();