【发布时间】:2014-01-19 18:29:41
【问题描述】:
我有一个使用 twisted 制作的简单代理服务器
destination = portforward.ProxyFactory(dest_host, dest_port)
reactor.listenTCP(listen_port, destination)
reactor.run()
我想在某些情况下更改 dest_port 而无需重新启动服务器。
我试过了:
new_dest = portforward.ProxyFactory(dest_host, new_dest_port)
reactor.listenTCP(listen_port, new_dest)
当然,这会产生地址已在使用中的异常。
这是否可以在运行期间更改代理目的地?
【问题讨论】: