urllib.urlopen returns 'connection refused' on Solaris

Jeff Bauer jbauer at rubic.com
Sun Jan 9 10:08:23 EST 2000


Stuart Reynolds wrote:
> Richard Gruet wrote:
> > On Solaris 2.6 (Sun OS 5.6), the fct urllib.urlopen() returns
> > an error 'Connection refused' for all URLs:
> 
> I had the same problem. Locally, we have some network security
> features installed that prevent direct access to http and ftp 
> address by any program. We can run Netscape as it uses a 
> proxy server.

If a proxy server is causing your connection problem, you
should be aware that urllib checks the environment for names 
that end in _proxy  (i.e. 'http_proxy').  You can assign
a value to the environment or as part of URLopener
instantiation.  A quick read of the urllib source will
explain all.

Proxies for the ftp protocol aren't as consistent
as http, IIRC.  The technique varies with the kind
of proxy used.  Since there are a limited number
of techniques, it might prove useful to write an
ftpprobe script to pursue known ftp proxy techniques
and report the successful strategy back to the user.

Or is this becoming increasing irrelevant as
security administrators shut down unencrypted 
ftp ports?

Jeff Bauer
Rubicon Research




More information about the Python-list mailing list