()
| 3062 | } |
| 3063 | |
| 3064 | private getLocalIPs(): string[] { |
| 3065 | const nets = os.networkInterfaces(); |
| 3066 | const ips: string[] = []; |
| 3067 | for (const name of Object.keys(nets)) { |
| 3068 | for (const net of nets[name] ?? []) { |
| 3069 | if (net.family === "IPv4" && !net.internal) { |
| 3070 | ips.push(net.address); |
| 3071 | } |
| 3072 | } |
| 3073 | } |
| 3074 | return ips; |
| 3075 | } |
| 3076 | |
| 3077 | private serveLocalIPs(res: http.ServerResponse): void { |
| 3078 | const ips = this.getLocalIPs(); |
no test coverage detected