mirror of
https://github.com/JamesonHuang/OpenWrt_Luci_Lua.git
synced 2024-11-27 23:40:10 +00:00
19 lines
438 B
Python
19 lines
438 B
Python
|
# Copyright (c) Twisted Matrix Laboratories.
|
||
|
# See LICENSE for details.
|
||
|
|
||
|
"""
|
||
|
This example demonstrates how to run a reverse proxy.
|
||
|
|
||
|
Run this example with:
|
||
|
$ python reverse-proxy.py
|
||
|
|
||
|
Then visit http://localhost:8080/ in your web browser.
|
||
|
"""
|
||
|
|
||
|
from twisted.internet import reactor
|
||
|
from twisted.web import proxy, server
|
||
|
|
||
|
site = server.Site(proxy.ReverseProxyResource('www.yahoo.com', 80, ''))
|
||
|
reactor.listenTCP(8080, site)
|
||
|
reactor.run()
|