def connectServer(self, hostname, port):
"""Tell the proxy what the end server is and start the connection.
The messages in `self.client_queue` will automatically be consumed.
This method should only be called once.
:param str hostname:
:param int port:
"""
endpoint = TCP4ClientEndpoint(reactor, hostname, port)
protocol = ServerProtocol(
self.server_queue, self.client_queue)
connectProtocol(endpoint, protocol)
评论列表
文章目录