V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
treexie
V2EX  ›  分享创造

http-stat-rs:纯 rust 实现的类 curl 工具

  •  
  •   treexie · 30 天前 · 1351 次点击

    今天,我们向大家介绍一款强大的 HTTP 各阶段可视化工具 —— http-stat-rs,这是一款用 Rust 语言开发的现代化 HTTP 各阶段耗时工具,参考 golang 版本的 httpstat 。预编译程序的下载地址:https://github.com/vicanso/http-stat-rs/releases

    为什么选择 http-stat-rs ?

    1. 全协议支持 全面支持 HTTP/1.1 、HTTP/2 和 HTTP/3 协议,支持 ALPN (应用层协议协商) h2, http/1.1 ,让您轻松测试不同 HTTP 协议版本的性能表现
    2. 更多现代高化压缩算法支持,gzip ,Brotli (br),Zstandard (zstd)
    3. 强大的 DNS 解析功能,可以直接指定域名对应多个 IP 地址,或指定只解析 ipv4 或 ipv6 的
    4. 跨平台支持提供 Windows 、macOS 和 Linux 的预编译二进制文件,无任何其它的依赖,开箱即用
    httpstat visualizes curl(1) statistics in a way of beauty and clarity.
    
    Usage: httpstat [OPTIONS] [URL_ARG]
    
    Arguments:
      [URL_ARG]  url to request
    
    Options:
      -u, --url <URL>          URL to request (optional, can be provided as the last argument)
      -H <HEADERS>             set HTTP header; repeatable: -H 'Accept: ...' -H 'Range: ...'
      -4                       resolve host to ipv4 only
      -6                       resolve host to ipv6 only
      -k                       skip verify tls certificate
      -o <OUTPUT>              output file
      -L                       follow 30x redirects
      -X <METHOD>              HTTP method to use (default GET)
      -d, --data <DATA>        the body of a POST or PUT request; from file use @filename
          --resolve <RESOLVE>  resolve the request host to specific ip address (e.g. 1.2.3.4,1.2.3.5)
          --compressed         request compressed response: gzip, br, zstd
          --http3              use http/3
          --http2              use http/2
          --http1              use http/1.1
      -s                       silent mode
      -h, --help               Print help
      -V, --version            Print version
    

    示例:

    httpstat --http3 https://cloudflare-quic.com/
    
    Connected to 104.22.9.38:443
    H3 200 OK
    Tls: tls 1.3
    Cipher: AES_256_GCM_SHA384
    Not-Before: 2025-04-27 23:05:22 +08:00
    Not-After: 2025-07-27 00:04:40 +08:00
    
    Date: Wed, 21 May 2025 14:07:16 GMT
    Content-Type: text/html
    Content-Length: 125959
    Priority: u=3,i=?0
    Server: cloudflare
    Cf-Ray: 9434a39c6c1ced3b-SJC
    Alt-Svc: h3=":443"; ma=86400
    Server-Timing: cfExtPri
    
          DNS Lookup          QUIC Connect      Server Processing     Content Transfer
    [       232ms        |       784ms        |       384ms        |       3.07s        ]
                         |                    |                    |                    |
                                                                                    Total:4.47s
    
    
    3 条回复    2025-05-22 20:07:22 +08:00
    aa51513
        1
    aa51513  
       30 天前
    不考虑上各大 Linux 发行版的软件仓库吗?
    kekeones
        2
    kekeones  
       30 天前
    试了下,一直是 Error: timeout error deadline has elapsed
    treexie
        3
    treexie  
    OP
       30 天前
    @aa51513 暂时没有此计划,直接下载可执行文件即可


    @kekeones 是请求哪个 url 呢?`https://cloudflare-quic.com/` 不是所有地区都能连得上
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2607 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 20ms · UTC 13:47 · PVG 21:47 · LAX 06:47 · JFK 09:47
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.