30 Commits
Author SHA1 Message Date
tsosunchia b56d4f72b5 fix(tos): 补强跨平台字段设置与策略路由选源 (#236)
保留完整 8 位 TOS 参数,传播初始化失败,修复 Linux 策略路由选源与 MTR socket 轮换,并为 Windows 非零 ICMPv4 TOS 使用 WinDivert。补齐三平台抓包、Linux 隔离路由验收及平台文档。
2026-09-08 10:19:50 +08:00
tsosunchia d7a68e57c1 fix(deploy): 在初始化前限制 MCP 与 Web 探测参数 2026-09-05 20:17:50 +08:00
tsosunchia c865f0c436 perf(geo): 限制共享缓存并隔离查询 2026-09-05 00:49:54 +08:00
tsosunchia 17e6a6c235 perf(server): 避免重复初始化 DN42 配置 2026-09-04 22:25:36 +08:00
tsosunchia 58f47c6773 perf(dn42): 索引 GeoFeed 最长前缀查询
- 以不可变 IPv4/IPv6 prefix map 发布可刷新快照
- 固定各执行会话的 GeoFeed generation 并在 MTR reset 时刷新
- 保留旧接口并覆盖 CLI、Web、service、nali、MTU 与 FastTrace 入口
2026-09-04 21:18:17 +08:00
tsosunchia 9e7304992f fix(server): 避免 v4 请求初始化 v3 连接 2026-08-14 21:10:28 +08:00
tsosunchia df516310ec refactor(api): 统一官方 API 命名与 provider 规范值
- 将公共 data_provider 统一为 NextTrace-API,并保留旧别名输入兼容
- 按 v3/v4 语义重命名内部实现并保留 Deprecated Go 包装
- 同步 CLI、Web、MCP、文档及输出规范化测试
2026-08-14 19:37:55 +08:00
tsosunchia bf8475df71 fix(output): 跨 Trace 入口透传终止原因 2026-08-13 11:25:52 +08:00
tsosunchia 1c8155a502 feat: add deploy MCP auth 2026-04-29 12:01:04 +08:00
tsosunchia 0ddac64b7a Fix source-device normalization and deploy smoke tests 2026-04-08 20:46:33 +08:00
tsosunchia 2a5717aedf Fix explicit source/device handling across platforms
Keep the default traceroute path unchanged when neither --source nor --dev is set so existing source address selection, socket setup, and logging stay untouched.

Add a shared explicit source/device normalization helper and route the CLI traceroute path, standalone --mtu path, fast_trace, and server trace requests through it. The helper keeps --source higher priority than --dev, resolves device-derived source addresses by destination family, rejects devices without a usable address, and emits at most one runtime warning.

On macOS, bind TCP and UDP send sockets to the requested interface with IP_BOUND_IF/IPV6_BOUND_IF so explicit --dev survives utun default routes. On Linux, bind ICMP/TCP/UDP send sockets with SO_BINDTODEVICE only when a source device is explicitly configured.

On Windows, keep the existing no-rewrite constraint for real device binding. Explicit --dev now resolves a source address, clears SourceDevice before the tracer is built, and surfaces a single warning that actual egress still follows system routing.

Update CLI help text and README platform notes to document the supported --dev semantics, and add unit tests that cover no-op behavior without explicit overrides, --source priority, device family resolution, mismatch errors, and the Windows downgrade warning.
2026-04-07 17:00:53 +08:00
tsosunchia 7b8e68710c Fix cancellation handling across DNS, trace, and ws flows 2026-03-19 12:22:02 +08:00
tsosunchia cff34d401e feat: update probe packet size handling and defaults across CLI and server 2026-03-17 22:11:13 +08:00
tsosunchia d9dbcc2a38 feat: align psize semantics and add tos 2026-03-17 16:41:10 +08:00
tsosunchia fe8f1aea75 feat: refactor flag registration functions and enhance trace map URL handling 2026-03-13 20:49:38 +08:00
tsosunchia 4f4cb0dc16 feat: enhance target port stripping and add tests for edge cases 2026-03-10 23:20:48 +08:00
tsosunchia 81797d4b5f Improve gocyclo complexity 2026-03-08 10:54:41 +08:00
tsosunchia 27a84fa5b5 feat: add environment variable documentation and implement CORS middleware for browser access 2026-03-08 08:17:13 +08:00
tsosunchia f69903a00c fix(web): resolve post-v1.5.0 review findings
Address all three review findings from the v1.5.0..HEAD audit:\n- Remove Web MTR reliance on process-wide globals (SrcDev/DisableMPLS) by passing session-scoped trace.Config fields.\n- Apply dot_server consistently to Web/API Geo DNS and LeoMoe/FastIP initialization via scoped resolver setup.\n- Restore Web MTR default per-hop cadence to 1000ms and send hop_interval_ms from frontend.\n\nAlso added regression tests in server/trace_handler_test.go and util/dns_resolver_test.go, and updated CLAUDE.md.\n\nValidation passed:\n- go test ./...\n- go build ./...\n- go build -tags flavor_ntr ./...\n- go build -tags flavor_tiny ./...\n- node --check server/web/assets/app.js
2026-03-06 13:04:42 +08:00
tsosunchia 3a6ba0a99e fix(web-mtr): 修复 Per-Hop 并发下超发残影与长持锁阻塞问题
- 修复 WebSocket MTR per-hop 路径中 traceMu 长时间持锁,改为仅初始化阶段短暂加锁,避免持续探测期间阻塞其他请求
- 新增 hop_interval_ms 请求字段,保留 interval_ms 兼容,并按 hop_interval_ms -> interval_ms -> 1000ms 回退
- 前端新增 knownFinalTTL 截断逻辑:命中目标 TTL 后下调水标并清理高 TTL 过期行,拦截后续高 TTL 迟到数据
- 在 clearResult(resetState) 中重置截断水标,避免会话间状态污染
- 新增前端截断行为测试,覆盖下调、剪枝、丢弃与重置场景
- 回归通过:前端聚合测试、Go 构建与现有测试集均通过
2026-03-01 22:38:33 +08:00
tsosunchia df19f6b58a fix: CWE-117 2026-02-28 13:38:12 +08:00
tsosunchia 2240f7959d fix: handle LeoMoe override correctly
- re-evaluate LeoMoe websocket flag after NEXTTRACE_DATAPROVIDER override in server trace handler
  - mirror the same check in CLI init so the websocket is only opened when the final provider is still
    LEOMOEAPI

Signed-off-by: tsosunchia <59512455+tsosunchia@users.noreply.github.com>
2025-10-29 22:38:28 +08:00
tsosunchia 6c12de9842 Ensure Leo data provider always initialises websocket 2025-10-29 22:16:12 +08:00
tsosunchia 95d18fcec2 Remove obsolete case for IP2REGION in trace_handler.go
移除已弃用的 Ip2region 数据源处理
2025-10-29 14:50:18 +08:00
tsosunchia b76c6034a1 Refactor WebSocket connection state management with mutex for thread safety 2025-10-29 14:24:17 +08:00
tsosunchia 81373fb3a4 Refactor trace_handler.go to improve variable naming for clarity 2025-10-29 12:48:35 +08:00
tsosunchia 3715f3b183 Refactor trace_handler.go to improve target parsing and error handling 2025-10-29 11:20:18 +08:00
tsosunchia d46731fb49 mtr 模式 2025-10-20 20:48:18 +08:00
tsosunchia 46dd4a11f1 流式传输 2025-10-20 17:16:08 +08:00
tsosunchia 762579e8be 增加depoly模式 2025-10-20 16:25:48 +08:00