socks.py 文件源码

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

项目:Tinychat-Bot--Discontinued 作者: Tinychat 项目源码 文件源码
def sendto(self, bytez, *args, **kwargs):
        if self.type != socket.SOCK_DGRAM:
            return _BaseSocket.sendto(self, bytez, *args, **kwargs)
        if not self._proxyconn:
            self.bind(("", 0))

        address = args[-1]
        flags = args[:-1]

        header = BytesIO()
        r_s_v = b"\x00\x00"
        header.write(r_s_v)
        s_t_a_n_d_a_l_o_n_e = b"\x00"
        header.write(s_t_a_n_d_a_l_o_n_e)
        self._write_socks5_address(address, header)

        sent = _BaseSocket.send(self, header.getvalue() + bytez, *flags, **kwargs)
        return sent - header.tell()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号