proxy??

Discussion in 'Python' started by Jorge Alberto Diaz Orozco, Nov 20, 2012.

  1. 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.

    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
     
    Jorge Alberto Diaz Orozco, Nov 20, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. vidy5300
    Replies:
    0
    Views:
    874
    vidy5300
    Jun 7, 2004
  2. Replies:
    0
    Views:
    1,646
  3. Karsten Wutzke
    Replies:
    1
    Views:
    881
    Steven Simpson
    Aug 20, 2007
  4. Klein Stéphane
    Replies:
    3
    Views:
    596
    Steve Holden
    Dec 20, 2009
  5. Alejandro Molina

    Proxy and non Proxy configurations

    Alejandro Molina, Jul 15, 2004, in forum: ASP .Net Security
    Replies:
    0
    Views:
    150
    Alejandro Molina
    Jul 15, 2004
Loading...

Share This Page