From 7a2c6b9825b00c49537c02d7776bf4c6b960685e Mon Sep 17 00:00:00 2001 From: Alexander Bersenev Date: Fri, 13 Sep 2019 01:19:19 +0500 Subject: [PATCH] cast client port to int --- mtprotoproxy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mtprotoproxy.py b/mtprotoproxy.py index 3e4527f..6a27f85 100755 --- a/mtprotoproxy.py +++ b/mtprotoproxy.py @@ -1005,7 +1005,7 @@ async def handle_proxy_protocol(reader, peer=None): if proxy_fam in (PROXY_TCP4, PROXY_TCP6): if len(proxy_addr) == 4: src_addr = proxy_addr[0].decode('ascii') - src_port = proxy_addr[2].decode('ascii') + src_port = int(proxy_addr[2].decode('ascii')) return (src_addr, src_port) elif proxy_fam == PROXY_UNKNOWN: return peer