def do_send(self, addr, message):
"""
send message to addr
where addr is a 2-tuple of type: (onion host, onion port)
"""
onion_host, onion_port = addr
tor_endpoint = self.tor.stream_via(onion_host, onion_port)
send_message_protocol = Int32StringReceiver()
self.remote_mix_protocol = yield endpoints.connectProtocol(tor_endpoint, send_message_protocol)
self.remote_mix_protocol.sendString(message)
self.remote_mix_protocol.transport.loseConnection()
# Protocol parent method overwriting
评论列表
文章目录