From 7d912f2cf26cdb458cbc9d670c4babc8887356d1 Mon Sep 17 00:00:00 2001 From: kaktus40 Date: Wed, 27 Apr 2022 20:57:45 +0200 Subject: [PATCH] compliant with networkInterfaces from nodeJs 18 --- src/utils/getIp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/getIp.js b/src/utils/getIp.js index 4b30717..22192cd 100644 --- a/src/utils/getIp.js +++ b/src/utils/getIp.js @@ -3,4 +3,4 @@ import { networkInterfaces } from 'os'; export const getIp = () => Object.values(networkInterfaces()) .flat() - .find(ip => ip.family == 'IPv4' && !ip.internal).address; + .find(ip => (ip.family === 'IPv4' || ip.family === 4) && !ip.internal).address;