Created
December 10, 2012 21:30
-
-
Save wrunk/4253572 to your computer and use it in GitHub Desktop.
Python WSGI Proxy
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
# A simple example of using the simple wsgiproxy as a nudge fallback app. | |
# We used this to proxy unfinished requests from appengine, back to our | |
# ec2 app | |
from nudge.publisher import ServicePublisher | |
from wsgiproxy.app import WSGIProxyApp | |
PROTO = 'http' | |
FALLBACK_HOST = 'example.com' | |
def proxy(environ, start_response): | |
app = WSGIProxyApp("%s://%s" % (PROTO, FALLBACK_HOST)) | |
return app(environ, start_response) | |
# You would need to actually add some nudge endpoints here | |
endpoints = [] | |
wsgi_app = ServicePublisher( | |
endpoints=endpoints, | |
fallbackapp=proxy | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment