Linux : curlコマンドにproxy設定をする

curlコマンドにProxy設定を行いたい。

方法:

Commandの引数として設定する

 
$ curl www.yahoo.co.jp -x http://hogehoge:PassWord@192.168.0.1:8080 
 

bashrcに環境変数として定義する

 
$ cat .bashrc
export http_proxy=http://hogehoge:PassWord@192.168.0.1:8080
export https_proxy=http://hogehoge:PassWord@192.168.0.1:8080
 

curlの設定Fileに定義する

 
$ cat .curlrc
proxy=http://hogehoge:PassWord@192.168.0.1:8080
 

備考:

Ubuntu 22.04.2 LTS
curl 7.81.0