MCPcopy Index your code
hub / github.com/anomalyco/opencode / getNetworkIPs

Function getNetworkIPs

packages/opencode/src/cli/cmd/web.ts:9–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7import { networkInterfaces } from "os"
8
9function 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
31export const WebCommand = effectCmd({
32 command: "web",

Callers 1

web.tsFile · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected