Commit Graph
82 Commits
Author SHA1 Message Date
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 20ad874194 fix(trace): 保留终止 marker 并按语义维护 MTR 边界
- 分离人类响应与机器 marker,并聚合有界 MTR 终止证据
- 保留 TUI/report 截断后的 marker,区分终端样式与文件纯文本
- 明确输出优先级并补齐 CLI、Fast、Web 回归测试与文档
2026-08-13 12:21:37 +08:00
tsosunchia bf8475df71 fix(output): 跨 Trace 入口透传终止原因 2026-08-13 11:25:52 +08:00
tsosunchia b1113b3423 fix(fast-trace): v4 token 跳过 v3 WS 初始化 2026-06-10 17:56:48 +08:00
tsosunchia bf1158c698 refactor(fast-trace): 直接复用 wshandle WS 初始化 2026-06-10 17:44:18 +08:00
tsosunchia aa1cc95e23 fix(fast-trace): 移除重复 signal 注册 2026-06-10 17:42:11 +08:00
tsosunchia 9c73c9d983 fix(fast-trace): 修正 runtime prepared 判定 2026-06-10 16:39:48 +08:00
tsosunchia 2a8467b0c1 fix(fast-trace): 复用 v4 token runtime 初始化 2026-06-10 16:06:33 +08:00
tsosunchia 11f6b48fa7 fix(mcp): 修复 PR review 反馈
- 为 stdin reader 使用 per-request response,避免并发调用串线
- 统一 Fast Trace IPv4/IPv6 非取消错误处理,移除 log.Fatal 分支
- 加固 deploy auth cookie 与 MCP session 测试 helper
- 显式断言 MTR MCP capability 工具存在
2026-05-01 08:05:22 +08:00
tsosunchia fc0d9af40f fix(nexttrace): stop cancel-triggered retry loops 2026-04-30 14:49:22 +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 d05329276b Fix CLI, MTU, logging, and websocket regressions 2026-03-19 11:08:20 +08:00
tsosunchia e060c33777 feat: Enhance traceroute output handling and add tests
- Added support for output path and default output flag in traceroute commands.
- Implemented output path resolution logic with conflict checks.
- Updated globalping and MTR modes to handle new output options.
- Enhanced MTU mode with styled output and improved result printing.
- Refactored table printer to support clear screen option and added tests for table output.
- Introduced new logging functions in tracelog for better file handling and real-time output.
- Added comprehensive tests for new features and existing functionalities.
2026-03-18 22:49:22 +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 8806c3b24f fix: close stale ws client loops and clear init deadline 2026-03-16 21:43:06 +08:00
tsosunchia d96c09a6ff refactor remaining gocyclo hotspots 2026-03-08 14:09:03 +08:00
tsosunchia 81797d4b5f Improve gocyclo complexity 2026-03-08 10:54:41 +08:00
tsosunchia efb437fbac fix: improve error handling and logging across multiple packages
- Enhanced error handling in `mtr_ui.go` to log warnings when raw mode cannot be enabled.
- Updated `geofeed.go` to return a more informative error instead of panicking when geofeed data cannot be loaded.
- Refined error handling in `ptr.go` to return an error if `ptrPath` is not configured.
- Improved error handling in `fast_trace.go` for network interface address retrieval.
- Added error checks in `chunzhen.go` and `ipapicom.go` for HTTP request creation and response reading.
- Enhanced error handling in `ipdbone.go` to return descriptive errors for authentication failures.
- Updated `ipfilter.go` to ensure proper IP parsing before filtering.
- Improved error handling in `ipinfoLocal.go` for database access and record parsing.
- Enhanced error handling in `ipsb.go` for HTTP request creation and response reading.
- Added checks for closed channels in `leo.go` to prevent panics.
- Improved panic recovery in `ws_handler.go` to log errors in the write loop.
- Added read deadline to WebSocket connections in `ws_handler.go` to prevent blocking.
- Enhanced configuration checks in `globalping.go` to avoid nil pointer dereferences.
- Improved error logging in `icmp_ipv4.go` and `icmp_ipv6.go` for send errors.
- Enhanced error handling in `icmp_darwin.go`, `icmp_unix.go`, and `icmp_windows.go` for checksum setting.
- Improved error handling in TCP and UDP implementations across various platforms for checksum settings.
- Enhanced error handling in `tracemap.go` for proxy configuration.
- Improved type assertions in `util.go` for DNS cache lookups.
2026-03-02 00:14:49 +08:00
Yunlq 071a496cc3 修改了README,并完善了一些参数的说明和处理 2025-11-20 01:39:21 +08:00
Yunlq 72a3781ec5 优化了ICMP模式,提升了其在Windows上的表现 2025-10-04 10:59:43 +08:00
Yunlq c7e663fa99 优化了UDP模式,提升了其在NAT环境下的表现 2025-09-22 21:01:43 +08:00
Yunlq 10c567287e 完成了windows上的TCP路由跟踪 2025-09-13 02:04:26 +08:00
tsosunchia 7fec94c6d9 移除DontFragment功能 2025-08-26 19:58:04 +08:00
Yunlq 0070082101 运行了go fmt和goimports 2025-08-17 16:12:26 +08:00
Yunlq ea54b2c0c4 优化并统一了环境变量的读取和使用 2025-08-17 15:04:57 +08:00
tsosunchia bc5a370f3b fix bug: 三网快速测试选的广州/上海,结果测的是北京的 https://github.com/nxtrace/NTrace-core/issues/313
Signed-off-by: tsosunchia <59512455+tsosunchia@users.noreply.github.com>
2025-07-26 20:40:36 +08:00
tsosunchia 0f8a646d71 fasttrace 增加上海/广州单独测试选项 2025-04-15 16:08:11 +08:00
tsosunchiaandClaude-3.7-Sonnet bcd430c231 IPv6下也支持UDP Mode
Co-authored-by: Claude-3.7-Sonnet <ai@anthropic.com>
Co-authored-by: tsosunchia <59512455+tsosunchia@users.noreply.github.com>

 要提交的变更:
	修改:     cmd/cmd.go
	修改:     fast_trace/fast_trace ipv6.go
	修改:     trace/tcp_ipv6.go
	修改:     trace/trace.go
	重命名:   trace/udp.go -> trace/udp_ipv4.go
	新文件:   trace/udp_ipv6.go

Signed-off-by: tsosunchia <59512455+tsosunchia@users.noreply.github.com>
2025-04-14 23:25:18 +08:00
tsosunchia d233e0e38d fasttrace和filetrace支持udpmode,且增加fasttrace和filetrace的port自定义参数 2024-12-21 21:37:54 +08:00
tsosunchia 183516b14c 修改部分UI表达 2024-12-21 21:00:45 +08:00
tsosunchia 2f1e086c7d update: FT mode增加 CAN.CN2/CMIN2/CNC PEK.CN2 2024-09-10 10:58:27 +08:00
tsosunchia fa8f6687de FT:杭州CU Ipv6 2024-09-02 06:06:41 +00:00
tsosunchia f47e742d81 FT应用dot参数 2024-09-02 04:33:04 +00:00
tsosunchia 868bf3d691 FT提示修改 2024-09-01 15:37:45 +08:00
tsosunchia 79ac0bc456 FT增加北京CST和广州EDU 2024-09-01 15:24:10 +08:00
tsosunchia 2e9428ce76 fix:ftv6 color mode some bugs 2024-07-16 19:03:12 +08:00
tsosunchia d0fb43e947 add ipv4 tcp dontFragment option 2024-05-30 03:23:10 +00:00
tsosunchia f50ca1f7f8 修正之前对于payload size设置的错误表述 2024-05-30 00:29:53 +08:00
tsosunchia c6eb9bbd2e 修复ft时个别地方未应用色彩参数的问题
交互式变基操作正在进行中;至 cbc511f
 最后完成的命令(1 条命令被执行):
    pick 356e3db 修复ft时个别地方未应用色彩参数的问题
 接下来要执行的命令(剩余 1 条命令):
    pick 9ee7c3f 修正在ECMP网络下的表现 之前ECMP网络可能会导致一次trace的结果来自不同flow(按icmp id区分的策略下),目前id不再携带TTL信息,因此一次trace的id将保持一致。  要提交的变更: 	修改:     trace/icmp_ipv4.go 	修改:     trace/icmp_ipv6.go
 您在执行将分支 'main' 变基到 'cbc511f' 的操作。

 要提交的变更:
	修改:     fast_trace/fast_trace.go
2024-04-06 20:07:17 +08:00
tsosunchia cbc511f097 修改一些显示问题,对于FASTTRACE/TESTFILE功能应用NO_COLOR属性,对于TESTFILE应用IP隐匿功能。
修改:     fast_trace/fast_trace.go
2024-03-31 12:42:20 +08:00
tsosunchia ef0631fdab fix: 可能发生资源泄漏,在 for 循环中调用 defer 2023-12-08 16:16:38 +08:00
tsosunchia c0455ca8e7 api变更 2023-12-01 16:32:44 +08:00
tsosunchia 701abc3447 增加file参数支持文件读取列表进行路由测试 2023-10-14 09:08:29 +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 2c86f86204 fix bugs:ipv6下fasttrace异常退出的问题 2023-06-04 05:27:21 +08:00