From 8b6ea6c206d992ce8b9ca4d6fadf75d660db5b17 Mon Sep 17 00:00:00 2001 From: Liad Yosef Date: Mon, 5 Feb 2024 17:01:48 +0200 Subject: [PATCH] change dns resolution order to ipv4 --- utopia-remix/app/util/proxy.server.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utopia-remix/app/util/proxy.server.ts b/utopia-remix/app/util/proxy.server.ts index 669ca8394ebd..6d65b84f8384 100644 --- a/utopia-remix/app/util/proxy.server.ts +++ b/utopia-remix/app/util/proxy.server.ts @@ -1,6 +1,11 @@ import urljoin from "url-join"; import { ServerEnvironment } from "../env.server"; import { proxiedResponse } from "./api.server"; +import dns from "dns"; + +// this is a workaround for default DNS resolution order with Node > 17 (where ipv6 is first) +// https://github.com/node-fetch/node-fetch/issues/1624#issuecomment-1235826631 +dns.setDefaultResultOrder("ipv4first"); const BASE_URL = ServerEnvironment.BackendURL;