Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 22000  / 3 Years ago, wed, september 29, 2021, 2:58:21

I´m using proxy and don´t have problems with anything except cURL.



Anytime i try to do:



curl -L http://link.to.something


i receive:



curl: (5) Couldn't resolve proxy 'http'


Nevertheless:



curl --proxy http://myproxy.com:8080 -L http://link.to.something


will work good.



Is there any solution for not writing --proxy everytime?


More From » 12.04

 Answers
6

From man curl:



-x, --proxy <[protocol://][user@password]proxyhost[:port]>

Use the specified HTTP proxy.
If the port number is not specified, it is assumed at port 1080.


For general use, declare environment variables for http/https



export http_proxy=http://your.proxy.server:port/
export https_proxy=$http_proxy



  1. edit /etc/bash.bashrc add to the end of file :




    export http_proxy=http://username:[email protected]:port/
export https_proxy=$http_proxy
export ftp_proxy=http://username:[email protected]:port/




  • OR proxy no username and password case - :




    export http_proxy=http://proxyserver.com:port/
export https_proxy=$http_proxy
export ftp_proxy=http://proxyserver.com:port/


[#32799] Thursday, September 30, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
initiallartebeest

Total Points: 24
Total Questions: 118
Total Answers: 105

Location: Venezuela
Member since Thu, Jul 15, 2021
3 Years ago
;