Skip to content

Instantly share code, notes, and snippets.

@hakanu
Created February 21, 2017 22:29
Show Gist options
  • Save hakanu/9ce2cf9dc26056fd35a87c712fe98716 to your computer and use it in GitHub Desktop.
Save hakanu/9ce2cf9dc26056fd35a87c712fe98716 to your computer and use it in GitHub Desktop.
Minimal proxy server for get requests
# -- 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