Skip to content

Cherrling/httpping

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

httpping

我完全不会 Go,仓库内容 100% GPT 5.4 Vibe Coding

一个尽量只依赖 Go 标准库的 HTTP 延迟测速工具,支持把 targetHostSNI 分开控制,适合 CDN / 代理 / 回源链路探测。

特性

  • 默认 simple 文本输出
  • 支持 -f, --format 切换 simple / json
  • 支持 target 作为 flag 或位置参数,参数可写在前后任意位置
  • 支持独立配置 -host-sni
  • 支持 -notls 关闭 TLS,支持 -insecure 跳过证书校验
  • 支持 -n 多次测速、-i/--interval 发起间隔
  • 负间隔(如 --interval=-1ms)进入严格串行模式
  • 支持 warm up(-warmup / -warmup-count

构建

go build -o httpping .

运行示例

./httpping https://1.2.3.4/
./httpping -host cdn.example.com https://1.2.3.4/
./httpping -host cdn.example.com -sni tls.example.com https://1.2.3.4/
./httpping -n 5 -i 200ms https://1.2.3.4/
./httpping -n 5 --interval=-1ms https://1.2.3.4/
./httpping -warmup-count 2 -n 5 https://1.2.3.4/
./httpping -insecure https://1.2.3.4/
./httpping -notls https://1.2.3.4/
./httpping -f json https://1.2.3.4/

位置参数与 flag 可混用:

./httpping https://1.2.3.4/ -host cdn.example.com -n 3

参数

  • -target:目标地址,支持 http:// / https://;省略 scheme 时默认 https://
  • -host:HTTP Host 头
  • -sni:TLS SNI
  • -f, --format:输出格式,simplejson(默认 simple
  • -insecure:使用 TLS 但跳过证书校验
  • -notls:强制使用明文 HTTP
  • -n:正式测速次数,默认 1
  • -i, --interval:发起间隔,默认 1s;负值表示严格串行
  • -warmup:开启 warm up,默认 1 次
  • -warmup-count:指定 warm up 次数(>0 会隐式开启 warm up)
  • -timeout:单次请求超时,默认 10s

输出

simple

输出人类可读文本:配置、每次测量、汇总统计(first byte / total 的 avg/min/max)。

json

仅输出 JSON(不会混入文本日志),适合给其他程序调用。主要结构:

  • config:本次测速配置(目标、Host/SNI、TLS 模式、次数、间隔、超时)
  • attempts:每次测量结果(状态码、响应体大小、各阶段耗时)
  • summaryfirst_bytetotalavg_ns/min_ns/max_ns

示例:

./httpping -f json -n 2 https://1.2.3.4/

帮助

./httpping -h

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages