()
| 22 | * and we deliberately avoid any network call for a startup hint. |
| 23 | */ |
| 24 | export function listNetworkAddresses(): NetworkAddress[] { |
| 25 | const raw: NetworkAddress[] = []; |
| 26 | for (const entries of Object.values(networkInterfaces())) { |
| 27 | for (const info of entries ?? []) { |
| 28 | if (info.internal) { |
| 29 | continue; |
| 30 | } |
| 31 | if (info.family === 'IPv4') { |
| 32 | raw.push({ address: info.address, family: 'IPv4' }); |
| 33 | } else if (info.family === 'IPv6') { |
| 34 | raw.push({ address: info.address, family: 'IPv6' }); |
| 35 | } |
| 36 | } |
| 37 | } |
| 38 | return filterDisplayAddresses(raw); |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * Drop addresses that are not useful as a connect target and de-duplicate. |
no test coverage detected