How to set a proxy for apt-cyg, http and socks? i tried using
export http_proxy=
but it did not work.
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.
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.
This should work :
export ftp_proxy=http://[user]:[passwd]@[proxy.foo.com]:[portnumber]
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]
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With