title: Using an HTTP PROXY - Python
body: <p>I familiar with the fact that I should set the HTTP_RPOXY environment variable to the proxy address.</p>
  <p>Generally urllib works fine, the problem is dealing with urllib2.</p>
  <pre><code>&gt;&gt;&gt; urllib2.urlopen(&quot;http://www.google.com&quot;).read()
  </code></pre>
  <p>returns</p>
  <pre><code>urllib2.URLError: &lt;urlopen error [Errno 10061] No connection could be made because the target machine actively refused it&gt;
  </code></pre>
  <p>or</p>
  <pre><code>urllib2.URLError: &lt;urlopen error [Errno 11004] getaddrinfo failed&gt;
  </code></pre>
  <hr />
  <h3>Extra info:</h3>
  <h3>urllib.urlopen(....) works fine! It is just urllib2 that is playing tricks...</h3>
  <p>I tried @Fenikso answer but I'm getting this error now:</p>
  <pre><code>URLError: &lt;urlopen error [Errno 10060] A connection attempt failed because the 
  connected party did not properly respond after a period of time, or established
  connection failed because connected host has failed to respond&gt;      
  </code></pre>
  <hr />
  <p>Any ideas?</p>