~nhanb/gae-proxy

7bce960f7ca94f529c5ab334c1f949b0bbc8af04 — Bùi Thành Nhân 2 years ago edcade2
tweaks
2 files changed, 7 insertions(+), 2 deletions(-)

M main.py
M send.py
M main.py => main.py +6 -1
@@ 1,6 1,11 @@
import os

import requests
from bottle import HTTPResponse, request, route, run

# GAE recommended
PORT = os.environ.get("PORT", 8080)

proxiable_methods = {
    "get": requests.get,
    "post": requests.post,


@@ 24,4 29,4 @@ def proxy():
    return HTTPResponse(body=resp.text, status=resp.status_code)


run(host="0.0.0.0", port=8080)
run(host="0.0.0.0", port=PORT)

M send.py => send.py +1 -1
@@ 5,7 5,7 @@ Lazy quick test script
"""

resp = requests.post(
    "https://nhansproxy.df.r.appspot.com",
    "https://nhansproxy.df.r.appspot.com/proxy",
    json={
        "url": "https://httpbin.org/get",
        "method": "get",