Commit Graph
22 Commits
Author SHA1 Message Date
tsosunchia 1cda0e53bb Fix context propagation and FastIP cache synchronization 2026-03-19 15:58:35 +08:00
tsosunchia 7b8e68710c Fix cancellation handling across DNS, trace, and ws flows 2026-03-19 12:22:02 +08:00
tsosunchia 77abf1b515 Refactor MTR signal handling and context management
- Unified signal handling in MTR CLI using `signal.NotifyContext(...)` for Ctrl-C/SIGTERM, removing the need for separate `sigCh` and goroutine.
- Updated `runMTRTUI`, `runMTRReport`, and `runMTRRaw` functions to utilize the new context management.
- Enhanced `mtrUI` to safely call `cancel()` only if it is not nil.
- Modified `IPDBOneClient` to clone HTTP clients with timeout settings, ensuring proper timeout handling without modifying global state.
- Adjusted raw aggregation keys in the frontend to collapse based on TTL, improving display of timeout/success results.
- Added context support in various tracer functions to allow cancellation and timeout handling.
- Improved error handling and test coverage for MTR operations, ensuring robustness against nil results and empty responses.
- Refined DNS resolver functions to use mutexes for thread-safe access to the geo resolver override.
2026-03-06 14:07:58 +08:00
tsosunchia 6c8912d78d feat(dns): 添加 Geo DNS 解析策略,支持 DoT 和系统 DNS 回退 2026-02-27 23:16:34 +08:00
tsosunchia ae08ec9796 fix(mtr): 提前冲突校验并修复 report 模式 CJK 对齐
- 将 MTR 冲突检查前移到所有 early-return 分支之前,避免 `-r --from`、`-t --fast-trace`、`--file` 等组合绕过校验
- report 输出改用 `go-runewidth` 计算显示宽度与截断(`StringWidth`/`Truncate`)
- 新增 `reportPadRight`,替换 `%*s` 对齐路径,修复中文场景下 HOST 与指标列错位
- 保持 wide/非 wide 逻辑不变,仅修复布局与参数校验时序
- tests: `go test -ldflags "-checklinkname=0" ./...`
2026-02-27 21:51:38 +08:00
tsosunchia 24224cf943 feat: Enhance MTR mode with source IP resolution and name mode toggle
- Removed the conflicting `--report` flag from MTR mode.
- Added `dataOrigin` parameter to `runMTRMode` for preferred API information.
- Implemented `resolveSrcIP` function to determine source IP based on priority.
- Introduced `nameMode` in `mtrUI` to toggle between PTR/IP and IP only display.
- Updated MTR table rendering functions to accommodate the new name mode.
- Enhanced tests to cover name mode functionality and API info display in TUI.
- Suppressed output of preferred API IP in MTR mode to avoid terminal pollution.
2026-02-27 20:50:47 +08:00
tsosunchia 3a09d28ea3 Handle error on response body close to prevent panic 2025-10-29 13:03:35 +08:00
tsosunchia 50a164c5ea Add nil check for response body to prevent panic 2025-10-29 12:58:16 +08:00
tsosunchia 123246c4ac 添加v6默认IP 2025-10-29 10:10:16 +08:00
Yunlq f177e370ad 新增环境变量NEXTTRACE_DEVMODE,启用时输出panic日志而非直接退出 2025-08-17 15:53:31 +08:00
tsosunchia b4d2038895 SNI和DNS不再分离,统一使用api.nxtrace.org 2025-07-08 11:30:21 +08:00
tsosunchia 6c49957be8 解决网络不通时的卡死问题 2025-01-05 12:24:58 +08:00
tsosunchia 760e751076 设置latency测试时的fallback 2024-02-05 16:31:07 +08:00
tsosunchia c0455ca8e7 api变更 2023-12-01 16:32:44 +08:00
tsosunchia f08778c862 修正部分typo 2023-10-13 18:34:14 +08:00
tsosunchia 960ab9687c 修复无v6网络下的连接问题 2023-10-12 17:47:31 +08:00
tsosunchia a6848f8f23 仓库用途变更
要提交的变更:
	修改:     .github/workflows/build.yml
	修改:     .github/workflows/publishNewFormula.yml
	修改:     README.md
	修改:     README_zh_CN.md
	修改:     fast_trace/fast_trace_test.go
	修改:     go.mod
	修改:     go.sum
	修改:     pow/pow.go
	修改:     printer/basic.go
	修改:     util/latency.go
	修改:     util/latency_test.go
	修改:     util/util.go
	修改:     wshandle/client.go
2023-10-08 17:15:29 +08:00
tsosunchia 1580c6111f add mpls func 2023-10-06 21:03:38 +08:00
tsosunchia 580612ce08 refactor: preparatory work 2023-06-26 14:49:05 +08:00
tsosunchia 089250fee1 提供不间断运行环境变量 2023-06-02 01:41:11 +08:00
tsosunchia 64371fb41a GetTracemap也适用优选IP 2023-06-01 15:40:04 +08:00
tsosunchia 4d7831fd29 pow使用的ip也是优选IP 2023-06-01 14:08:32 +08:00