Created
February 21, 2017 22:29
-
-
Save hakanu/9ce2cf9dc26056fd35a87c712fe98716 to your computer and use it in GitHub Desktop.
Minimal proxy server for get requests
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
# -- coding: utf-8 -- | |
import urllib | |
import json | |
import web | |
import requests | |
urls = ( | |
'/.*', 'MainHandler' | |
) | |
app = web.application(urls, globals()) | |
_REAL_SERVER_IP = 'http://192.168.0.19:8080' | |
class MainHandler: | |
def GET(self): | |
#print _REAL_SERVER_IP + web.ctx.fullpath | |
return (requests.get(_REAL_SERVER_IP + web.ctx.fullpath).text) | |
if __name__ == "__main__": | |
app.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment