How do I use cygwin behind the corporate firewall

NetworkingProxyCygwin

Networking Problem Overview


I'm in a Microsoft IE environment, but I want to use cygwin for a number of quick scripting tasks.

How would I configure it to use my windows proxy information? Ruby gems, ping, etc are all trying to make direct connections. How can I get them to respect the proxy information that IE and firefox use?

Networking Solutions


Solution 1 - Networking

Just for the records if you need to authenticate to the Proxy use:

export http_proxy=http://username:password@host:port/

Taken from: http://samueldotj.blogspot.com/2008/06/configuring-cygwin-to-use-proxy-server.html

Solution 2 - Networking

Most applications check one of the following environment variables (gem even checks both), so try putting this code in your .bashrc:

proxy=http://host.com:port/
export http_proxy=$proxy
export HTTP_PROXY=$proxy

Solution 3 - Networking

I doubt that your corporate firewall allows PING, but the others all appear to be one form of http or another. On a Linux system, you can set your HTTP proxy as an environment variable, so in bash, type:

export http_proxy=http://www.myproxy.com:3128

There is a similar environment variable for FTP (ftp_proxy).

Solution 4 - Networking

You can also set it on Windows environment variables and cygwin will load it on startup (little bonus: any command prompt on windows will also have it set).

Solution 5 - Networking

If I just use what Vlax and Mohsen Nosratinia suggested (export http_proxy=http://yourusername:yourpassword@host:port/), it will only work half of the programs (some of the installs will work but not all) for my company.

By adding another line it will work for all (maybe most) at least in my situation.

export http_proxy=http://yourusername:yourpassword@host:port/
export https_proxy=$http_proxy

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMattKView Question on Stackoverflow
Solution 1 - NetworkingVlaxView Answer on Stackoverflow
Solution 2 - NetworkingBruno De FraineView Answer on Stackoverflow
Solution 3 - NetworkingSteve MoyerView Answer on Stackoverflow
Solution 4 - NetworkingLuisView Answer on Stackoverflow
Solution 5 - Networkingian0411View Answer on Stackoverflow