def parse(self, reader, auth, authtable, sock, **kw):
if auth:
if (yield from reader.read_n(len(auth)-1)) != auth[1:]:
raise Exception('Unauthorized Redir')
authtable.set_authed()
buf = sock.getsockopt(socket.SOL_IP, SO_ORIGINAL_DST, 16)
return socket.inet_ntoa(buf[4:8]), int.from_bytes(buf[2:4], 'big'), b''
评论列表
文章目录