From b829cb4aff16661c5090a30bba49f40e75794348 Mon Sep 17 00:00:00 2001 From: shahargl Date: Sun, 24 Nov 2024 13:34:35 +0200 Subject: [PATCH] feat: wip --- keep-ui/auth.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/keep-ui/auth.ts b/keep-ui/auth.ts index d2736b3e4..92cd08dcd 100644 --- a/keep-ui/auth.ts +++ b/keep-ui/auth.ts @@ -44,7 +44,16 @@ const proxyUrl = import { ProxyAgent, fetch as undici } from "undici"; function proxy(...args: Parameters): ReturnType { - const dispatcher = new ProxyAgent(proxyUrl!); + const dispatcher = new ProxyAgent({ + uri: proxyUrl!, + // Force DNS resolution through the proxy + // Use requestTls to control connection behavior + requestTls: { + rejectUnauthorized: true, + // This will make the DNS resolution happen on the proxy side + servername: new URL(args[0].toString()).hostname, + }, + }); // @ts-expect-error `undici` has a `duplex` option return undici(args[0], { ...args[1], dispatcher }); }