almondrocks3.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:dtc2 作者: phobosgroup 项目源码 文件源码
def _handle_channel(self, sock):
        """
        Create a channel in the Tunnel to accommodate new SOCKS client, and proxy data to/from the SOCKS client
        through the tunnel.
        :param socket.socket sock: A newly connect SOCKS client
        """
        host, port = sock.getpeername()[:2]
        try:
            channel = self.tunnel.open_channel(self.channel_counter.__next__(), open_remote=True, exc=True)
        except ValueError as e:
            self.logger.error('Error occurred while opening channel: {}'.format(e))
            sock.close()
            return

        self.tunnel.proxy_sock_channel(sock, channel, self.logger)
        self.logger.info('Terminating thread that handled {} <--> {}:{}'.format(channel, host, port))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号