proxy??

Jorge Alberto Diaz Orozco jaorozco at estudiantes.uci.cu
Wed Nov 21 02:32:40 CET 2012


When I try to open facebook or search something using google it is just 
not working. gives me forbidden or not found errors. that's why I think 
the problem is about the headers of the request.

On 20/11/12 15:29, Joshua Landau wrote:
> On 20 November 2012 14:48, Jorge Alberto Diaz Orozco 
> <jaorozco at estudiantes.uci.cu <mailto:jaorozco at estudiantes.uci.cu>> wrote:
>
>     Hi there.
>     Does anyone knows how to manage headers using a simple proxy???
>     I'm doing this but It gives me problems In some pages.
>
>
> I don't know the answer, but I do know you'd get more favour if you 
> explained what"problems" and "In some pages" refer to.
>
>     import SocketServer
>     import SimpleHTTPServer
>     import urllib2
>
>     PORT = 8888
>
>     class Proxy(SimpleHTTPServer.SimpleHTTPRequestHandler):
>         def do_GET(self):
>             try:
>                 print self.path
>                 self.copyfile(urllib2.urlopen(self.path), self.wfile)
>             except:
>                 print 'error',self.path
>
>     httpd = SocketServer.ForkingTCPServer(('127.0.0.1', PORT), Proxy)
>     print "serving at port", PORT
>     httpd.serve_forever()
>



10mo. ANIVERSARIO DE LA CREACION DE LA UNIVERSIDAD DE LAS CIENCIAS INFORMATICAS...
CONECTADOS AL FUTURO, CONECTADOS A LA REVOLUCION

http://www.uci.cu
http://www.facebook.com/universidad.uci
http://www.flickr.com/photos/universidad_uci
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20121120/2da5acda/attachment-0001.html>


More information about the Python-list mailing list