Windows per-app traffic route ledger: where each program's traffic goes (direct, proxy node, TUN, LAN), from ETW plus optional Mihomo enrichment.
netwhere install # 注册后台采集进程(弹一次 UAC),登录时自动启动
netwhere status # 采集进程、代理内核、运行模式
netwhere trace -- git push # 在当前终端运行命令,报告它整个进程树的流量走向
netwhere report # 今天各应用的流量:经节点 / 内核直连 / 绕过内核 / 局域网
netwhere report --7d --by node # 近 7 天按节点汇总,并按倍率估算套餐消耗
netwhere unknown # 还没有归类的流量
netwhere classify example.com 工作 # 把域名或进程(xxx.exe)归到某个应用
netwhere rules list | add | remove
netwhere export --csv --30d --out usage.csv
netwhere uninstall [--purge]process destination entry exit up down conns rule
curl.exe tcp speed.cloudflare.com:443 proxy-port HK 01 950 B 19.1 MB 1 Match
curl.exe tcp speed.cloudflare.com:443 bypass - 0 B 2.9 KB 1| 层 | 取值 | 判断依据 |
|---|---|---|
| 入口(entry) | proxy-port 经代理端口进入内核 / tun 经 TUN 进入内核 / bypass 本机有内核但直接出网 / direct 本机没有内核时的直接出网 / lan 局域网 | 回环端口的监听者是否是代理内核(GetExtendedTcpTable);目的地址走哪块网卡(GetBestRoute2) |
| 出口(exit) | 某个节点 / 内核直连 DIRECT / 拒绝 REJECT / 未知 ? | 用源端口、进程名和时间窗口关联 Mihomo 的连接快照;快照没赶上的短连接,用 /logs 兜底 |
netwhered.exe(管理员权限,登录时由计划任务启动,无窗口)
ETW → 记账引擎 → %ProgramData%\netwhere\ledger.db(每 10 秒写一次)
Mihomo /connections + /logs(WebSocket,断线自动重连)
▲ 读 ledger.db │ 写 requests\*.json、config.json
netwhere.exe(普通权限)| 包 | 后端 | 内容 |
|---|---|---|
| netaddr | 全后端 | IP 地址和网段的规范化(ETW 输出未压缩的 IPv6,DNS 和 Mihomo 输出压缩形式) |
| ledger | 全后端 | 事件模型、规范化、录制格式、记账引擎、回放 |
| mihomo | 全后端 | /connections、/logs、/configs 解码 |
| rules | 全后端 | 域名和进程匹配、v2fly 数据格式、内置规则文件 |
| mailbox、config、report、installer、scenario | 全后端 | 信箱协议状态机、配置文件、输出格式、安装计划、场景校验 |
| etw、route、sys、store、mihomo/client | native | ETW 会话、IP Helper、进程与令牌、SQLite、WebSocket 客户端 |
| cmd/netwhere、cmd/netwhered、cmd/rules-import、cmd/nw-route | native | 命令行、采集进程、规则导入、路由诊断 |
moon check --target native
moon test --target native
moon build --target native --release.\scripts\record-scenarios.ps1 -Mode system-proxy # FlClash:开系统代理、关 TUN
.\scripts\record-scenarios.ps1 -Mode tun # FlClash:开 TUN(fake-ip)、关系统代理
netwhere verify testdata\raw\tun.manifest.json # 和预期的走向逐项对照
python -I scripts\sanitize_recording.py testdata\raw\tun.manifest.json testdata\scenariosgit clone --depth 1 https://github.com/v2fly/domain-list-community $env:TEMP\dlc
moon run cmd/rules-import -- $env:TEMP\dlc\data --apps rules\apps.txt --out rules\builtin.txt --source "v2fly/domain-list-community@<commit>"Install
Download zipWindows per-app traffic route ledger: where each program's traffic goes (direct, proxy node, TUN, LAN), from ETW plus optional Mihomo enrichment.