barabasz/urlinfo

PHP CLI 脚本,用于显示请求 URL 的最重要信息

v1.0.1 2023-08-10 23:59 UTC

This package is auto-updated.

Last update: 2024-09-13 18:52:09 UTC


README

urlinfo 是一个简单的 PHP CLI 包装器,围绕 cURL,允许以易于阅读的格式显示请求 URL 的最重要信息。

用法

urlinfo [options] URL

参数

URL - 请求的 URL

选项

-b      show body (only for unencoded text/plain content) 
-c      print verbose cURL info (without SSL info)
-f      ignore SSL errors
-H      print this info and exit
-h      print verbose response headers (without cookies and CSP)
-i      print verbose ipinfo
-m      mute standard output
-p      force plain text content response
-t      show script execution time
-v      print version and exit

输出示例

Example of utlinfo output

传输时间

TTFB (首次字节时间)

首次字节时间是计算为最终请求(客户端在 TCP 握手和 SSL 握手之后发送 GET)和接收到的第一个字节之间的时间(time_pretransfertime_starttransfer 之间的差异)。

传输时间

传输本身的时间,计算为总时间(time_total)和第一个字节即将传输的时间(time_starttransfer)之间的时间。

总时间

此请求的总时间,包括名称解析、握手和传输。