且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何设置curl永久使用代理?

更新时间:2023-02-24 11:39:50

您的〜/ .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>