Skip to content

Commit c8704c2

Browse files
committed
ipv6 hostname
1 parent c61f74c commit c8704c2

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pproxy/__doc__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__title__ = "pproxy"
2-
__version__ = "2.4.6"
2+
__version__ = "2.4.7"
33
__license__ = "MIT"
44
__description__ = "Proxy server that can tunnel among remote servers by regex rules."
55
__keywords__ = "proxy socks http shadowsocks shadowsocksr ssr redirect pf tunnel cipher ssl udp"

pproxy/server.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,11 @@ def compile(cls, uri, relay=None):
482482
cipher.plugins.append(plugin)
483483
match = cls.compile_rule(url.query) if url.query else None
484484
if loc:
485-
host_name, _, port = loc.partition(':')
485+
ipv6 = re.fullmatch('\[([0-9a-fA-F:]*)\](?::(\d+)?)?', loc)
486+
if ipv6:
487+
host_name, port = loc.groups()
488+
else:
489+
host_name, _, port = loc.partition(':')
486490
port = int(port) if port else (22 if 'ssh' in rawprotos else 8080)
487491
else:
488492
host_name = port = None

0 commit comments

Comments
 (0)