Skip to content

Commit

Permalink
feat: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
shahargl committed Nov 24, 2024
1 parent 198b50e commit b829cb4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion keep-ui/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,16 @@ const proxyUrl =

import { ProxyAgent, fetch as undici } from "undici";
function proxy(...args: Parameters<typeof fetch>): ReturnType<typeof fetch> {
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 });
}
Expand Down

0 comments on commit b829cb4

Please sign in to comment.