首页 > IT职业 > IT职场 > centos中http代理的使用

1、首先启动 Privoxy
# service privoxy start
如果需要关闭的话,使用
# service privoxy stop
2、设置HTTP代理地址
# export http_proxy='http://local-ip:8118'# export https_proxy='http://local-ip:8118'
3、访问浏览器进行测试
# curl google.com
4、如有返回内容,则说明设置成功。常用的话,每次重新登录都要输入2个export命令,这样比较麻烦。可在函数内封装设置和取消代理地址。在 ~/.bashrc 末尾添加
function proxy_on() { export http_proxy='http://127.0.0.1:8118' export https_proxy=$http_proxy echo 'Proxy on'}function proxy_off() { unset http_proxy unset https_proxy echo 'Proxy off'}
# source ~/.bashrc
5、使用proxy_on和 proxy_off设置和取消代理地址。
以上就是centos中http代理的使用,推荐大家使用品易http代理ip,高速稳定运行,解决ip限制。提供高匿稳定代理ip服务,方便快捷获取网站数据,流量免费测试正在进行!更多常见问题解决:ip
(推荐操作系统:windows7系统、Internet Explorer 11,DELL G3电脑。)
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/835/viewspace-2829015/ ,如需转载,请注明出处,否则将追究法律责任。