From bb0b0169c73ece2146346ff530eb0d18820d0b89 Mon Sep 17 00:00:00 2001 From: wuls Date: Fri, 28 Apr 2023 18:00:33 +0800 Subject: [PATCH] fix bug --- .../integrations/node/src/get-network-address.ts | 13 ------------- packages/integrations/node/src/standalone.ts | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) delete mode 100644 packages/integrations/node/src/get-network-address.ts diff --git a/packages/integrations/node/src/get-network-address.ts b/packages/integrations/node/src/get-network-address.ts deleted file mode 100644 index ff017b2e0..000000000 --- a/packages/integrations/node/src/get-network-address.ts +++ /dev/null @@ -1,13 +0,0 @@ -import os from 'os' -export function getNetworkAddress(){ - const interfaces = os.networkInterfaces(); - const ips: string[] = []; - Object.keys(interfaces).forEach((nic) => { - interfaces[nic]!.forEach((details) => { - if (details.family === 'IPv4' && !details.internal) { - ips.push(details.address); - } - }); - }); - return ips?.[0] ? ips?.[0] : '127.0.0.1'; -} diff --git a/packages/integrations/node/src/standalone.ts b/packages/integrations/node/src/standalone.ts index c573fcf5d..815640fc3 100644 --- a/packages/integrations/node/src/standalone.ts +++ b/packages/integrations/node/src/standalone.ts @@ -30,7 +30,7 @@ export function getResolvedHostForHttpServer(host: string | boolean) { return '127.0.0.1'; } else if (host === true) { // If passed --host in the CLI without arguments - return getNetworkAddress(); // undefined typically means 0.0.0.0 or :: (listen on all IPs) + return undefined; // undefined typically means 0.0.0.0 or :: (listen on all IPs) } else { return host; }