mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-01-17 03:18:58 +01:00
# Fix 410 Issue Correcte syntax write for connect server (#411)
This commit is contained in:
parent
9e78abd2c2
commit
580462156e
@ -64,6 +64,11 @@ def parse_hostport(rhostport):
|
||||
# default define variable
|
||||
port = ""
|
||||
username = re.split(r'\s*:', rhostport)[0]
|
||||
|
||||
# Fix #410 bad username error detect
|
||||
if "@" in username:
|
||||
username = re.split(r'\s*@', rhostport)[0]
|
||||
|
||||
password = None
|
||||
host = None
|
||||
|
||||
@ -82,9 +87,12 @@ def parse_hostport(rhostport):
|
||||
if host is None:
|
||||
# split for ipv4 or ipv6
|
||||
host = "{}".format(re.split(r'\s*@', rhostport)[1])
|
||||
|
||||
# try if port define
|
||||
try:
|
||||
port = re.split(r'\s*:', rhostport)[2].split('@')[0]
|
||||
# Fix #410 detect host:port
|
||||
port = re.split(r'\s*:', host)[1]
|
||||
host = re.split(r'\s*:', host)[0]
|
||||
except IndexError:
|
||||
pass
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user