Created
April 1, 2019 12:48
-
-
Save rikwatson/abd4bbbe6a6567069aa1e1a5b364ce49 to your computer and use it in GitHub Desktop.
HTTP Proxy in Python
This file contains 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
""" | |
From: http://wiki.python.org/moin/Twisted-Examples | |
Via: http://stackoverflow.com/questions/4412581 | |
""" | |
from twisted.web import proxy, http | |
from twisted.internet import reactor | |
from twisted.python import log | |
import sys | |
log.startLogging(sys.stdout) | |
class ProxyFactory(http.HTTPFactory): | |
protocol = proxy.Proxy | |
reactor.listenTCP(8080, ProxyFactory()) | |
reactor.run() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment