如何仅在某个目录上部署twisted?

时间:2016-04-25 20:44:07

标签: python proxy centos twisted reverse-proxy

我想知道你是否可以部署一个扭曲的服务器来只监听某个目录(exp:example.com/twisted)? 如果有帮助,这是我的代码:

from twisted.internet import reactor
from twisted.web import proxy, server
from twisted.python import log

site = server.Site(proxy.ReverseProxyResource('www.example.com', 80, ''.encode("utf-8")))
reactor.listenTCP(80, site)
reactor.run()

我在我的CentOS VPS上运行这个,谢谢!

0 个答案:

没有答案