通过运行“httptap --
开源推荐
evening
GitHub 热门项目:httptap
2026-07-06
1 阅读
约4分钟阅读
GitHub Trending
字号:
GitHub 项目:httptap
仓库地址:https://github.com/monasticacademy/httptap
星级:4166 | 作者:修道院学院
项目描述:查看任何Linux程序发出的HTTP/HTTPS请求
===================================================
自述文件内容:
httptap
通过运行“httptap --”查看任何 Linux 程序发出的 HTTP 和 HTTPS 请求。例如,以下命令在“monasticacademy.org”上运行curl,这会导致HTTP状态为308(重定向):
````外壳
$ httptap --curl https://monasticacademy.org
---> 获取 https://monasticacademy.org/
<--- 308 https://monasticacademy.org/(15 字节)
````
现在让我们用来自 python 的 HTTP 请求尝试同样的事情。
````外壳
httptap -- python -c“导入请求;requests.get('https://monasticacademy.org')”
---> 获取 https://monasticacademy.org/
<--- 308 https://monasticacademy.org/(15 字节)
---> 获取 https://www.monasticacademy.org/
<--- 200 https://www.monasticacademy.org/(5796 字节)
````
这次我们看到 python 遵循重定向并获得 200 OK 响应:
要运行“httptap”,您不需要成为 root 用户。您不需要设置任何类型的守护进程或对系统进行任何系统范围的更改(编辑:在 Ubuntu 23.10 及更高版本上,您将需要运行 [下面记录的 sysctl](#ubuntu-2310-and-later))。它不会创建任何 iptables 规则或更改路由表,并且通常不会影响同一系统上运行的任何其他进程。 `httptap` 可执行文件是一个静态 Go 二进制文件,无需依赖即可运行。
Httptap 目前仅运行在 Linux 上。它使用特定于 Linux 的系统调用——特别是网络命名空间——不幸的是,这将使其很难移植到其他操作系统。如果您知道如何将 httptap 移植到其他操作系统,请与我们联系!
# 安装预构建的二进制文件
````外壳
卷曲 -L https://github.com/monasticacademy/httptap/releases/latest/download/httptap_linux_$(uname -m).tar.gz |焦油 xzf -
````
对于所有版本和 CPU 架构,请参阅[版本](https://github.com/monasticacademy/httptap/releases/latest)。
# 使用 Go 安装
````外壳
去安装 github.com/monasticacademy/httptap@latest
````
# Ubuntu 23.10 及更高版本
在 Ubuntu 23.10 及更高版本上,您需要运行以下命令才能使用 httptap:
````外壳
sudo sysctl -w kernel.apparmor_restrict_unprivileged_unconfined=0
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
````
瓦
通过运行“httptap --
这篇文章对您有帮助吗?
订阅66必读
每日精选科技资讯,直达你的邮箱