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

104 天前
 treexie

今天,我们向大家介绍一款强大的 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

1502 次点击
所在节点    分享创造
3 条回复
aa51513
104 天前
不考虑上各大 Linux 发行版的软件仓库吗?
kekeones
104 天前
试了下,一直是 Error: timeout error deadline has elapsed
treexie
103 天前
@aa51513 暂时没有此计划,直接下载可执行文件即可


@kekeones 是请求哪个 url 呢?`https://cloudflare-quic.com/` 不是所有地区都能连得上

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1133376

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX