File: googleProxy.py

package info (click to toggle)
python-klein 24.8.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,016 kB
  • sloc: python: 6,371; makefile: 130
file content (16 lines) | stat: -rw-r--r-- 236 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import treq

from klein import Klein


app = Klein()


@app.route("/", branch=True)
def google(request):
    d = treq.get("https://www.google.com" + request.uri)
    d.addCallback(treq.content)
    return d


app.run("localhost", 8080)