Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set a proxy for apt-cyg?

How to set a proxy for apt-cyg, http and socks? i tried using

export http_proxy= 

but it did not work.

like image 584
Tareq Ibrahim Avatar asked Oct 21 '11 15:10

Tareq Ibrahim


People also ask

How do I use a proxy to curl?

To use a proxy with Curl, you must pass the required proxy address using the -x (or --proxy) command-line option and proxy credentials using the -U (or --proxy-user) command-line switch. Proxy credentials may also be passed in the proxy string and will be URL decoded by Curl.

How do I change my proxy settings in Git?

Configure the proxy You can configure these globally in your user ~/. gitconfig file using the --global switch, or local to a repository in its . git/config file.


4 Answers

This should work :

export ftp_proxy=http://[user]:[passwd]@[proxy.foo.com]:[portnumber]
like image 67
Romain Avatar answered Oct 08 '22 06:10

Romain


You can also add it all in one line (it works well with cygwin/apt-get embedded in mobaxterm - add it to .bashrc):

export {ftp,http,https}_proxy=http://[user]:[passwd]@[proxy.foo.com]:[port]
like image 26
TrYde Avatar answered Oct 08 '22 05:10

TrYde


I'm not sure about Cygwin, but these are the lines from my ~/.bashrc

export http_proxy=http://[user]:[passwd]@[proxy.foo.com]:[portnumber]
export https_proxy=http://[user]:[passwd]@[proxy.foo.com]:[portnumber]
export HTTP_PROXY=http://[user]:[passwd]@[proxy.foo.com]:[portnumber]
export HTTPS_PROXY=http://[user]:[passwd]@[proxy.foo.com]:[portnumber]

If cygwin is similar to bash, it should work.

like image 25
vinaykola Avatar answered Oct 08 '22 06:10

vinaykola


I made it work by setting two Windows environment variables: http_proxy and http_proxy. I previously had HTTP_PROXY, but that wasn't picked up.

Note that as Cygwin is a Windows process, after setting the new environment variables you need to launch a new Cygwin process to pick up the change.

like image 44
Brian Beckett Avatar answered Oct 08 '22 05:10

Brian Beckett