海运的博客

用Curl调试web服务器

发布时间:May 9, 2012 // 分类:常用软件 // No Comments

Curl是款功能很强大的www客户端,之前介绍过用curl上传下载FTP文件,本次记录下curl用于调试web服务器常用的命令。
1.获取服务器head信息:

curl -I https://www.haiyun.me

2.测试服务器网页压缩,如返回乱码即压缩。

curl  -H  "Accept-Encoding: gzip" https://www.haiyun.me

3.查看请求及返回head信息,如服务器支持压缩会返回Content-Encoding: gzip。

curl -v -I -H  "Accept-Encoding: gzip" https://www.haiyun.me

4.测试服务器虚拟主机:

curl -L -H "Host: www.haiyun.me" http://192.168.1.2/

5.测试HTTP性能:

curl -so /dev/null -w "%{time_namelookup} %{time_connect} %{time_redirect} %{time_pretransfer} \
%{time_starttransfer} %{time_total}\n" www.haiyun.me

6.测试服务器KeepAlive:

curl -v -I -H "Keep-Alive: 60" -H "Connection: keep-alive" www.haiyun.me www.haiyun.me

7.测试Proxy:

curl -I --proxy 192.168.1.1:7070 www.haiyun.me
curl -I --socks5 192.168.1.1:7070 www.haiyun.me

8.指定域名对应ip地址,相对于host支持https sni。

curl --resolve www.haiyun.me:443:1.2.3.4 https://www.haiyun.me/
分类
最新文章
最近回复
  • 海运: 恩山有很多。
  • swsend: 大佬可以分享一下固件吗,谢谢。
  • Jimmy: 方法一 nghtp3步骤需要改成如下才能编译成功: git clone https://git...
  • 海运: 地址格式和udpxy一样,udpxy和msd_lite能用这个就能用。
  • 1: 怎么用 编译后的程序在家里路由器内任意一台设备上运行就可以吗?比如笔记本电脑 m参数是笔记本的...
  • 孤狼: ups_status_set: seems that UPS [BK650M2-CH] is ...
  • 孤狼: 擦。。。。apcupsd会失联 nut在冲到到100的时候会ONBATT进入关机状态,我想想办...
  • 海运: 网络,找到相应的url编辑重发请求,firefox有此功能,其它未知。
  • knetxp: 用浏览器F12网络拦截或监听后编辑重发请求,修改url中的set为set_super,将POS...
  • Albert: 啊啊啊啊啊啊啊啊啊 我太激动了,终于好了英文区搜索了半天,翻遍了 pve 论坛没找到好方法,博...