Skip to content

Instantly share code, notes, and snippets.

@ithinkihaveacat
Created February 13, 2011 16:24
Show Gist options
  • Select an option

  • Save ithinkihaveacat/824819 to your computer and use it in GitHub Desktop.

Select an option

Save ithinkihaveacat/824819 to your computer and use it in GitHub Desktop.
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