urlopen through firewall

Xose L. Gonzalez XoseLuis at retemail.es
Fri Feb 11 15:52:10 EST 2000


Fredrik,

Thank you for your quick anwer and help effort.

Unfortunately the enviroment variable setting (with the right port number
and right proxi address) did not work :(


> <F note="mailed and posted">
>
> Xose L. Gonzalez wrote:
> > When I try to connect to the webserver through  "urlopen", it is
> > impossible when inside firewall, whereas the same code works without
> > firewall involved
> >
> > which is the solution?
>
> set the http_proxy environment variable to point to your
> proxy server.  e.g:
>
>     import os, urllib
>
>     os.environ["http_proxy"] = http://proxy.spam.egg:1234"
>
>     # connect to www.python.org through proxy.spam.egg:1234
>     fp = urllib.urlopen("http://www.python.org")
>
> if you prefer, you can of course set the environment
> variable outside your program (using the usual shell
> commands).
>
> </F>




More information about the Python-list mailing list