如何设置curl以永久使用代理? [英] How do I set up curl to permanently use a proxy?
本文介绍了如何设置curl以永久使用代理?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何设置"curl"以在终端中永久使用代理服务器?
How can I set up "curl" to permanently use a proxy server in the terminal?
推荐答案
您可以在〜/.bashrc文件中创建别名:
You can make a alias in your ~/.bashrc file :
alias curl="curl -x <proxy_host>:<proxy_port>"
另一种解决方案是使用(可能是更好的解决方案)~/.curlrc
文件(如果不存在则创建它):
Another solution is to use (maybe the better solution) the ~/.curlrc
file (create it if it does not exist) :
proxy = <proxy_host>:<proxy_port>
这篇关于如何设置curl以永久使用代理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文