Created
February 13, 2011 16:24
-
-
Save ithinkihaveacat/824819 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment