让你的curl支持http2

1安装nghttp2

源码位置:https://github.com/nghttp2/nghttp2.git

编译步骤:

$ autoreconf -i
$ automake
$ autoconf
$ ./configure
$ make
$ make install

 在目录 /etc/ld.so.conf添加动态库

touch /etc/ld.so.conf.d/nghttp2.conf  创建该文件
/usr/local/lib  添加路径

更新配置文件,执行ldconfig

* python最低版本为3.8,所以需要安装高版本python

1.1安装python3

源码位置:https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tgz

tar -xzf Python-3.9.0.tgz

./configure --prefix=/usr/local/python3

make && make install

ln -s /usr/local/python3/bin/python3 /usr/bin/python3

2安装高版本curl

源码位置:https://curl.se/download/curl-7.77.0.tar.gz

tar -xzf curl-7.77.0.tar.gz

./configure --with-nghttp2=/usr/local --with-ssl

make

查看版本信息:

===========以上编译成功 =========

用法具体

../curl-7.77.0/src/curl --http2 -skvo /dev/null "https://www.sina.com"

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值