httpstat 应该是一个 python 封装后的 curl 工具能够展现 一些客户端连接网站的时间消耗,最近在看tls 感觉挺有用处的 简单学习一下

1. centos7 安装python 和 pip

yum intall python -y
#安装python
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
#下载pip安装文件
python get-pip.py
#安装pip

2. 安装httpstat模块

pip install httpstat

3. 检测一下连接信息等

命令和结果分别为

httpstat www.ibm.com

Connected to 221.230.145.189: from 10.24.101.161:

HTTP/1.1  Moved Permanently
Server: GHost
Content-Length:
Location: https://www.ibm.com/
Date: Fri, Sep :: GMT
Connection: keep-alive
X-Content-Type-Options: nosniff
X-XSS-Protection: ; mode=block
Content-Security-Policy: upgrade-insecure-requests Body stored in: /tmp/tmpUz7t3D DNS Lookup TCP Connection Server Processing Content Transfer
[ 5515ms | 46ms | 51ms | 0ms ]
| | | |
namelookup:5515ms | | |
connect:5561ms | |
starttransfer:5612ms |
total:5612ms

百度的结果为:

httpstat www.baidu.com
Connected to 115.239.210.27: from 10.24.101.161: HTTP/1.1 OK
Accept-Ranges: bytes
Cache-Control: private, no-cache, no-store, proxy-revalidate, no-transform
Connection: Keep-Alive
Content-Length:
Content-Type: text/html
Date: Fri, Sep :: GMT
Etag: "58860504-94d"
Last-Modified: Mon, Jan :: GMT
Pragma: no-cache
Server: bfe/1.0.8.18
Set-Cookie: BDORZ=; max-age=; domain=.baidu.com; path=/ Body stored in: /tmp/tmpcavbBI DNS Lookup TCP Connection Server Processing Content Transfer
[ 28ms | 60ms | 60ms | 0ms ]
| | | |
namelookup:28ms | | |
connect:88ms | |
starttransfer:148ms |
total:148ms

需要指定是 https 还是 http 不然 走的貌似不是一个 如下面。

格式坏了 将就着看吧


[root@centos75master ~]# httpstat https://www.baidu.com
Connected to 115.239.210.27:443 from 10.24.101.161:50884

HTTP/1.1 200 OK
Accept-Ranges: bytes
Cache-Control: private, no-cache, no-store, proxy-revalidate, no-transform
Connection: Keep-Alive
Content-Length: 2443
Content-Type: text/html
Date: Fri, 21 Sep 2018 08:16:09 GMT
Etag: "58860429-98b"
Last-Modified: Mon, 23 Jan 2017 13:24:57 GMT
Pragma: no-cache
Server: bfe/1.0.8.18
Set-Cookie: BDORZ=27315; max-age=86400; domain=.baidu.com; path=/

Body stored in: /tmp/tmpkUm2PH

DNS Lookup TCP Connection TLS Handshake Server Processing Content Transfer
[ 4ms | 30ms | 125ms | 36ms | 0ms ]
| | | | |
namelookup:4ms | | | |
connect:34ms | | |
pretransfer:159ms | |
starttransfer:195ms |
total:195ms

[root@centos75master ~]# httpstat http://www.baidu.com
Connected to 115.239.211.112:80 from 10.24.101.161:44078

HTTP/1.1 200 OK
Accept-Ranges: bytes
Cache-Control: private, no-cache, no-store, proxy-revalidate, no-transform
Connection: Keep-Alive
Content-Length: 2381
Content-Type: text/html
Date: Fri, 21 Sep 2018 08:16:16 GMT
Etag: "588604fc-94d"
Last-Modified: Mon, 23 Jan 2017 13:28:28 GMT
Pragma: no-cache
Server: bfe/1.0.8.18
Set-Cookie: BDORZ=27315; max-age=86400; domain=.baidu.com; path=/

Body stored in: /tmp/tmpMV8IXt

DNS Lookup TCP Connection Server Processing Content Transfer
[ 4ms | 31ms | 39ms | 1ms ]
| | | |
namelookup:4ms | | |
connect:35ms | |
starttransfer:74ms |

 

网上一个其他命令

httpstat https://www.baidu.com -X POST --data-urlencode "a=b" -v

httpstat的简单使用的更多相关文章

  1. 【造轮子】打造一个简单的万能Excel读写工具

    大家工作或者平时是不是经常遇到要读写一些简单格式的Excel? shit!~很蛋疼,因为之前吹牛,就搞了个这东西,还算是挺实用,和大家分享下. 厌烦了每次搞简单类型的Excel读写?不怕~来,喜欢流式 ...

  2. Fabio 安装和简单使用

    Fabio(Go 语言):https://github.com/eBay/fabio Fabio 是一个快速.现代.zero-conf 负载均衡 HTTP(S) 路由器,用于部署 Consul 管理的 ...

  3. node.js学习(三)简单的node程序&&模块简单使用&&commonJS规范&&深入理解模块原理

    一.一个简单的node程序 1.新建一个txt文件 2.修改后缀 修改之后会弹出这个,点击"是" 3.运行test.js 源文件 使用node.js运行之后的. 如果该路径下没有该 ...

  4. 哪种缓存效果高?开源一个简单的缓存组件j2cache

    背景 现在的web系统已经越来越多的应用缓存技术,而且缓存技术确实是能实足的增强系统性能的.我在项目中也开始接触一些缓存的需求. 开始简单的就用jvm(java托管内存)来做缓存,这样对于单个应用服务 ...

  5. 在Openfire上弄一个简单的推送系统

    推送系统 说是推送系统有点大,其实就是一个消息广播功能吧.作用其实也就是由服务端接收到消息然后推送到订阅的客户端. 思路 对于推送最关键的是服务端向客户端发送数据,客户端向服务端订阅自己想要的消息.这 ...

  6. 我的MYSQL学习心得(一) 简单语法

    我的MYSQL学习心得(一) 简单语法 我的MYSQL学习心得(二) 数据类型宽度 我的MYSQL学习心得(三) 查看字段长度 我的MYSQL学习心得(四) 数据类型 我的MYSQL学习心得(五) 运 ...

  7. 使用 Nodejs 搭建简单的Web服务器

    使用Nodejs搭建Web服务器是学习Node.js比较全面的入门教程,因为要完成一个简单的Web服务器,你需要学习Nodejs中几个比较重要的模块,比如:http协议模块.文件系统.url解析模块. ...

  8. ASP.NET Aries 入门开发教程2:配置出一个简单的列表页面

    前言: 朋友们都期待我稳定地工作,但创业公司若要躺下,也非意念可控. 若人生注定了风雨飘摇,那就雨中前行了. 最机开始看聊新的工作机会,欢迎推荐,创业公司也可! 同时,趁着自由时间,抓紧把这系列教程给 ...

  9. 简单入门canvas - 通过刮奖效果来学习

    一 .前言 一直在做PC端的前端开发,从互联网到行业软件.最近发现移动端已经成为前端必备技能了,真是不能停止学习.HTML5新增的一些东西,canvas是用的比较多也比较复杂的一个,简单的入门了一下, ...

随机推荐

  1. 10-[协程] greenlet模块、 gevent模块

    1.greenlet模块:实现20个任务切换 如果我们在单个线程内有20个任务,要想实现在多个任务之间切换,使用greenlet模块可以非常简单地实现这20个任务直接的切换 使用yield生成器的方式 ...

  2. CF 1114 E. Arithmetic Progression

    E. Arithmetic Progression 链接 题意: 交互题. 有一个等差序列,现已打乱顺序,最多询问60次来确定首项和公差.每次可以询问是否有严格大于x的数,和查看一个位置的数. 分析: ...

  3. CF 258 D. Little Elephant and Broken Sorting

    D. Little Elephant and Broken Sorting 链接 题意: 长度为n的序列,m次操作,每次交换两个位置,每次操作的概率为$\frac{1}{2}$,求m此操作后逆序对的期 ...

  4. js 知识点整理

    1. indexOf 与String类似,Array也可以通过indexOf()来搜索一个指定的元素的位置: var arr = [10, 20, '30', 'xyz']; arr.indexOf( ...

  5. [VB.NET][C#]二维向量的基本运算

    前言 在数学中,几何向量指具有大小(Magnitude)和方向的几何对象,它在线性代数中经由抽象化有着更一般的概念.向量在编程中也有着及其广泛的应用,其作用在图形编程和游戏物理引擎方面尤为突出. 基于 ...

  6. Permission Policies

    The Permission Policy determines Security System behavior when there are no explicitly specified per ...

  7. 14-Dockerfile常用指令

    下面列出了 Dockerfile 中最常用的指令,完整列表和说明可参看官方文档.FROM 指定 base 镜像. MAINTAINER设置镜像的作者,可以是任意字符串. COPY将文件从 build ...

  8. python属性访问

    1.python属性访问魔法方法: >>> class C: def __getattribute__(self,name): print("getattribute&qu ...

  9. 六边形地图Cube coordinates理解

    1.这个是 Axial coordinates,可以实现六边形4个方向上的移动 2.但是六边形还有两个方向需要移动,所以引入了Cube coordinates,这个坐标系多了一个轴向,Y轴,X轴沿水平 ...

  10. == 和 equals 的区别是什么?

    已经有很多人说过二者的区别了,我直接上代码. String strA = "123"; String strB = "123"; String strC = & ...