MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / listNetworkAddresses

Function listNetworkAddresses

apps/kimi-code/src/cli/sub/server/networks.ts:24–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22 * and we deliberately avoid any network call for a startup hint.
23 */
24export 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.

Callers 1

accessUrlLinesFunction · 0.90

Calls 3

filterDisplayAddressesFunction · 0.85
valuesMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected