from werkzeug.datastructures import MultiDict
from flask import Flask, Response, request
from werkzeug.routing import Rule
import requests

app = Flask(__name__)
app.url_map.add(Rule('/<path:url>', endpoint='root'))
BLOCK_HEADERS = ['Host', 'Content-Length']


@app.endpoint('root')
def root(url):
    response = requests.request(
            method=request.method,
            url='http://' + url,
            stream=True,
            params=request.args,
            headers={k:v for k,v in request.headers if k not in BLOCK_HEADERS},
            data=request.get_data(),
            cookies=request.cookies)

    return Response(
            response.raw, # direct file interface
            headers=response.raw.headers.items(),
            status=response.status_code,
            direct_passthrough=True)

21e36283587c2db1c89388de3260d4921c13ba47
<mask token>


@app.endpoint('root')
def root(url):
    response = requests.request(method=request.method, url='http://' + url,
        stream=True, params=request.args, headers={k: v for k, v in request
        .headers if k not in BLOCK_HEADERS}, data=request.get_data(),
        cookies=request.cookies)
    return Response(response.raw, headers=response.raw.headers.items(),
        status=response.status_code, direct_passthrough=True)

<mask token>
app.url_map.add(Rule('/<path:url>', endpoint='root'))
<mask token>


@app.endpoint('root')
def root(url):
    response = requests.request(method=request.method, url='http://' + url,
        stream=True, params=request.args, headers={k: v for k, v in request
        .headers if k not in BLOCK_HEADERS}, data=request.get_data(),
        cookies=request.cookies)
    return Response(response.raw, headers=response.raw.headers.items(),
        status=response.status_code, direct_passthrough=True)

<mask token>
app = Flask(__name__)
app.url_map.add(Rule('/<path:url>', endpoint='root'))
BLOCK_HEADERS = ['Host', 'Content-Length']


@app.endpoint('root')
def root(url):
    response = requests.request(method=request.method, url='http://' + url,
        stream=True, params=request.args, headers={k: v for k, v in request
        .headers if k not in BLOCK_HEADERS}, data=request.get_data(),
        cookies=request.cookies)
    return Response(response.raw, headers=response.raw.headers.items(),
        status=response.status_code, direct_passthrough=True)

from werkzeug.datastructures import MultiDict
from flask import Flask, Response, request
from werkzeug.routing import Rule
import requests
app = Flask(__name__)
app.url_map.add(Rule('/<path:url>', endpoint='root'))
BLOCK_HEADERS = ['Host', 'Content-Length']


@app.endpoint('root')
def root(url):
    response = requests.request(method=request.method, url='http://' + url,
        stream=True, params=request.args, headers={k: v for k, v in request
        .headers if k not in BLOCK_HEADERS}, data=request.get_data(),
        cookies=request.cookies)
    return Response(response.raw, headers=response.raw.headers.items(),
        status=response.status_code, direct_passthrough=True)

from werkzeug.datastructures import MultiDict
from flask import Flask, Response, request
from werkzeug.routing import Rule
import requests

app = Flask(__name__)
app.url_map.add(Rule('/<path:url>', endpoint='root'))
BLOCK_HEADERS = ['Host', 'Content-Length']


@app.endpoint('root')
def root(url):
    response = requests.request(
            method=request.method,
            url='http://' + url,
            stream=True,
            params=request.args,
            headers={k:v for k,v in request.headers if k not in BLOCK_HEADERS},
            data=request.get_data(),
            cookies=request.cookies)

    return Response(
            response.raw, # direct file interface
            headers=response.raw.headers.items(),
            status=response.status_code,
            direct_passthrough=True)
