Skip to content

Commit

Permalink
asd
Browse files Browse the repository at this point in the history
  • Loading branch information
Hydralerne committed Aug 15, 2024
1 parent a91dd20 commit dbb7977
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions node/ip.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ const os = require('os');
function getNetwork(e) {
return new Promise((resolve, reject) => {
const interfaces = os.networkInterfaces();
resolve(interfaces);
for (let interfaceName in interfaces) {
for (let iface of interfaces[interfaceName]) {
if (iface.family === 'IPv4' && !iface.internal && (iface.cidr?.includes('/24') || iface.cidr?.address.includes('192'))) {
if (iface.family === 'IPv4' && !iface.internal && (iface.cidr?.includes('/24') || iface.cidr?.address?.includes('192'))) {
resolve({ip: iface.address});
}
}
Expand Down

0 comments on commit dbb7977

Please sign in to comment.