Nobody knows? But why?

Horkoff, Dave dhorkoff at genusrmt.ca
Tue Jan 29 18:57:33 CET 2002


You could also take a look at the code for the NTML Proxy Server, which is a
proxy server writen in python designed to tunnel through an MS proxy server.
I've tried it and it works quite well.

http://www.geocities.com/rozmanov/ntlm/

Hope this helps give you some ideas,
David.

-----Original Message-----
From: Schollnick, Benjamin [mailto:Benjamin.Schollnick at usa.xerox.com]
Sent: January 29, 2002 6:53 AM
To: 'printers at sendme.cz'; python-list at python.org; tutor at python.org;
activepython at listserv.ActiveState.com
Subject: RE: Nobody knows? But why?


>From what I am reading in the Python Documentation....
(See Index, Proxy, Page 288)

You need to use URLLIB2, instead of Httplib, and set the
ProxyHandler method...

Httplib just does not have the intelligence to deal with proxies,
unless my docs have become outdated...

It's (httplib) is just the basic functions for accessing the URL's.
Urllib & Urllib2 are "extendors", which build upon the functionality
of the httplib.

		- Benjamin

-----Original Message-----
From: A [mailto:printers at sendme.cz]
Sent: Tuesday, January 29, 2002 8:57 AM
To: python-list at python.org; tutor at python.org;
activepython at listserv.ActiveState.com
Subject: Nobody knows? But why?




Hi,
For already some time I am trying to use  
modules, HTTPLIB or URLLIB to get a page through proxy but so 
far I have not been successfull
I also browsed Python group but the samples given there did not 
work.
Can anybody give me a WORKING example how I can grab a web 
page through proxy?
I tried this example
########################
#######################

import httplib
h = httplib.HTTP('209.242.141.249:8080') #proxy

h.putrequest('GET', 'http://www.autoplzen.info/index.php')

h.putheader('Accept', 'text/html')
h.putheader('Accept', 'text/plain')

#h.putrequest('Proxy-Connection', 'Keep-Alive') # it does not work, 
#so  I commented

#h.putrequest('Host', 'www.autoplzen.info')  the same,otherwise I 
#receive File "C:\PYTHON21\lib\httplib.py", line 430, in putrequest  
#  raise CannotSendRequest()

h.endheaders()
errcode, errmsg, headers = h.getreply()
print errcode # Should be 200


#######################################
The above example works as if there were no proxy because in 
web server log there is not  IP of Proxy but mine.

Any help would be appreciated.
thanks
Ladislav


------- End of forwarded message -------
_______________________________________________
ActivePython mailing list
ActivePython at listserv.ActiveState.com
To unsubscribe:
http://listserv.ActiveState.com/mailman/listinfo/activepython
_______________________________________________
ActivePython mailing list
ActivePython at listserv.ActiveState.com
To unsubscribe:
http://listserv.ActiveState.com/mailman/listinfo/activepython
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20020129/8fef0d38/attachment.html>


More information about the Python-list mailing list