From 29576be00514f58f4532d7de0cde55adcf8860fa Mon Sep 17 00:00:00 2001 From: German Date: Thu, 3 Dec 2020 12:49:57 +0300 Subject: [PATCH] parse hostname in url without port issue Test case: pproxy -r socks5://10.0.0.1 Actual behavior: pproxy: error: argument -r: invalid compile_relay value: 'socks5://10.0.0.1' Expected behavior: pproxy started --- pproxy/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pproxy/server.py b/pproxy/server.py index df28ebc..0f552b0 100644 --- a/pproxy/server.py +++ b/pproxy/server.py @@ -482,7 +482,7 @@ def compile(cls, uri, relay=None): cipher.plugins.append(plugin) match = cls.compile_rule(url.query) if url.query else None if loc: - host_name, _, port = loc.rpartition(':') + host_name, _, port = loc.partition(':') port = int(port) if port else (22 if 'ssh' in rawprotos else 8080) else: host_name = port = None