From 5014e5a845e6fffba2ffafee9fe054c8c7ebd1f9 Mon Sep 17 00:00:00 2001 From: Zhiming Ma Date: Tue, 28 May 2024 19:45:40 +0800 Subject: [PATCH] fix(agent): set dns resolving order to ipv4first. --- clients/tabby-agent/src/lsp/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clients/tabby-agent/src/lsp/index.ts b/clients/tabby-agent/src/lsp/index.ts index ff070da6f21b..fb7db2cad589 100644 --- a/clients/tabby-agent/src/lsp/index.ts +++ b/clients/tabby-agent/src/lsp/index.ts @@ -1,7 +1,12 @@ #!/usr/bin/env node +import * as dns from "node:dns"; import { TabbyAgent } from "../TabbyAgent"; import { Server } from "./Server"; +import { isBrowser } from "../env"; +if (!isBrowser) { + dns.setDefaultResultOrder("ipv4first"); +} const server = new Server(new TabbyAgent()); server.listen();