mirror of
https://github.com/JamesonHuang/OpenWrt_Luci_Lua.git
synced 2024-11-23 22:00:11 +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()
|