Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import SocketServer
- import SimpleHTTPServer
- import urllib
- PORT = 8080
- class Proxy(SimpleHTTPServer.SimpleHTTPRequestHandler):
- def do_GET(self):
- self.send_response(200)
- self.end_headers()
- self.copyfile(urllib.urlopen(self.path), self.wfile)
- httpd = SocketServer.ForkingTCPServer(('', PORT), Proxy)
- httpd.serve_forever()
Add Comment
Please, Sign In to add comment