1.获取服务器head信息:
1
| curl -I http://www.haiyun.me
|
2.测试服务器网页压缩,如返回乱码即压缩。
1
| curl -H "Accept-Encoding: gzip" http://www.haiyun.me
|
3.查看请求及返回head信息,如服务器支持压缩会返回Content-Encoding: gzip。
1
| curl -v -I -H "Accept-Encoding: gzip" http://www.haiyun.me
|
4.测试服务器虚拟主机:
1
| curl -H -L"Host: www.haiyun.me" http://192.168.1.2/
|
5.测试HTTP性能:
1
2
| curl -so /dev/null -w "%{time_namelookup} %{time_connect} %{time_redirect} %{time_pretransfer} \%{time_starttransfer} %{time_total}\n" www.haiyun.me
|
6.测试服务器KeepAlive:
1
| curl -v -I -H "Keep-Alive: 60" -H "Connection: keep-alive" www.haiyun.me www.haiyun.me
|
7.测试Proxy:
1
2
| curl -I --proxy 192.168.1.1:7070 www.haiyun.me
curl -I --socks5 192.168.1.1:7070 www.haiyun.me
|
列出FTP目录:
1
| curl -u user:passwd ftp://www.haiyun.me
|
下载文件:
1
| curl -u user:passwd ftp://www.haiyun.me/file.rar -o file.rar
|
上传文件:
1
| curl -u user:passwd -T file.rar ftp://www.haiyun.me
|