go

NextTrace 可视化路线跟踪

Posted by eye on 07-21,2024

NTrace

NextTrace,一个开源的可视化路线跟踪 CLI 工具 一个追求轻量级的开源可视化路由工具,使用Golang开发。

自动安装

  • Linux
    • 一键安装脚本
      curl nxtrace.org/nt |bash
      
    • Arch Linux AUR 安装命令
      • 直接下载bin包(仅支持amd64)
        yay -S nexttrace-bin
        
      • 从源代码构建(仅支持 amd64)
        yay -S nexttrace
        
      • AUR 版本由 ouuan、huyz 维护
    • Linuxbrew 的安装命令
      与 macOS Homebrew 的安装方法相同(homebrew-core 版本仅支持 amd64)
    • Deepin安装命令
      apt install nexttrace
      
    • Termux 安装命令
      pkg install nexttrace-enhanced
      
  • 苹果系统
    • macOS Homebrew 的安装命令- Homebrew-core 版本
      brew install nexttrace
      • 本仓库的ACTIONS自动构建版本(更新更快)
        brew tap nxtrace/nexttrace && brew install nxtrace/nexttrace/nexttrace
        
      • homebrew-core 版本由 chenrui333 维护,请注意,此版本的更新可能落后于存储库操作自动版本
  • Windows
    • Windows Scoop 安装命令- Scoop-extras 版本
      scoop bucket add extras && scoop install extras/nexttrace
      • Scoop-extra 由 soenggam 维护
        请注意,以上所有安装方式的仓库均由开源爱好者维护,不保证可用性和及时更新。如遇到问题,请联系仓库维护者解决,或使用本项目官方构建提供的二进制包。

手动安装

  • 下载预编译的可执行文件
    对于以上方法未涵盖到的用户,请直接前往Release下载编译好的二进制可执行文件。
    • Release为许多系统和不同的架构提供已编译的二进制可执行文件。如果没有可用的,您可以自行编译。
    • 该项目的一些基本依赖项尚未完全实现,Windows因此Golang目前在平台NextTrace上处于实验支持阶段Windows
  • 从源代码安装
    自行安装Go >= 1.20后,可以使用以下命令安装
    go install github.com/nxtrace/NTrace-core@latest
    
    由于版本约束冲突,无法 NTrace-V1通过此方法 安装 安装后可执行文件在 目录下$GOPATH/bin,如果没有设置GOPATH则在 目录下$HOME/go/bin二进制文件名与项目名一致,需要将nexttrace下面的命令替换为,如果要与下面的命令一致,可以在执行命令NTrace-core后重命名二进制文件go install
    mv  $GOPATH/bin/NTrace-core $GOPATH/bin/nexttrace
    

立即开始

NextTrace使用ICMP协议默认执行 TraceRoute 请求,该协议同时IPv4支持IPv6

# IPv4 ICMP Trace
nexttrace 1.0.0.1
# URL
nexttrace http://example.com:8080/index.html?q=1

# Form printing
nexttrace --table 1.0.0.1

# An Output Easy to Parse
nexttrace --raw 1.0.0.1
nexttrace --json 1.0.0.1

# IPv4/IPv6 Resolve Only, and automatically select the first IP when there are multiple IPs
nexttrace --ipv4 g.co
nexttrace --ipv6 g.co

# IPv6 ICMP Trace
nexttrace 2606:4700:4700::1111

# Disable Path Visualization With the -M parameter
nexttrace koreacentral.blob.core.windows.net
# MapTrace URL: https://api.nxtrace.org/tracemap/html/c14e439e-3250-5310-8965-42a1e3545266.html

# Disable MPLS display using the --disable-mpls / -e parameter or the NEXTTRACE_DISABLEMPLS environment variable
nexttrace --disable-mpls example.com
export NEXTTRACE_DISABLEMPLS=1