| 7 | import { networkInterfaces } from "os" |
| 8 | |
| 9 | function getNetworkIPs() { |
| 10 | const nets = networkInterfaces() |
| 11 | const results: string[] = [] |
| 12 | |
| 13 | for (const name of Object.keys(nets)) { |
| 14 | const net = nets[name] |
| 15 | if (!net) continue |
| 16 | |
| 17 | for (const netInfo of net) { |
| 18 | // Skip internal and non-IPv4 addresses |
| 19 | if (netInfo.internal || netInfo.family !== "IPv4") continue |
| 20 | |
| 21 | // Skip Docker bridge networks (typically 172.x.x.x) |
| 22 | if (netInfo.address.startsWith("172.")) continue |
| 23 | |
| 24 | results.push(netInfo.address) |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | return results |
| 29 | } |
| 30 | |
| 31 | export const WebCommand = effectCmd({ |
| 32 | command: "web", |