工具 版本
linux的版本: Debian 9 x86_64
Python版本: 3.6
httpry 0.1.8-1.el7

在linux上下载http监控工具httpry

yum install httpry

Python3监控linux服务器的http请求
在linux上安装subprocess模块

pip3 install subprocess

subprocess官网
Python代码

import subprocess
order='httpry'
pi= subprocess.Popen(order,shell=True,stdout=subprocess.PIPE)
while(1==1):
    for i in iter(pi.stdout.readline,'b'):
        print(i.decode('utf-8'))

说明:在jupyter中运行此代码,连接v2-ray去访问几个页面,然后多刷新几次,过一会jupyter会出现httpry的命令的输出。
Python3监控linux服务器的http请求
输出的字符没有弄的很好看。下一步考虑将数据可视化。准备采用Django。可以关注我的github https://github.com/realwuxiong/httpry

相关文章:

  • 2022-12-23
  • 2021-09-24
  • 2021-12-06
  • 2021-09-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-22
猜你喜欢
  • 2021-08-25
  • 2022-12-23
  • 2021-11-28
  • 2021-05-29
  • 2021-12-25
  • 2022-12-23
  • 2021-06-24
相关资源
相似解决方案