proto.py 文件源码

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

项目:python-proxy 作者: qwj 项目源码 文件源码
def correct_header(self, header, auth, sock, **kw):
        try:
            buf = sock.getsockopt(socket.SOL_IP, SO_ORIGINAL_DST, 16)
            assert len(buf) == 16
            remote = (socket.inet_ntoa(buf[4:8]), int.from_bytes(buf[2:4], 'big'))
            assert sock.getsockname() != remote
        except Exception:
            return False
        return auth and header == auth[:1] or not auth
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号