Skip to content

Commit

Permalink
#1271 allow "ws[s]/username:password@host:port/path?arg=val&etc" syntax
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@13562 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Sep 5, 2016
1 parent 1bb21e7 commit 32e8699
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/xpra/scripts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1383,22 +1383,23 @@ def parse_host_string(host):
ws_proto, host = display_name.split(separator, 1)
if host.find("?")>=0:
host, _ = host.split("?", 1)
iport = 0
port = 0
if host.find(":")>=0:
host, port = host.split(":", 1)
if port.find("/")>=0:
port, extra = port.split("/", 1)
host += extra
iport = int(port)
if host.find("/")>=0:
host, extra = host.split("/", 1)
else:
extra = ""
username, password, host, port = parse_host_string(host)
host += extra
#TODO: parse attrs after "?"
desc.update({
"type" : ws_proto, #"ws" or "wss"
"local" : False,
"display" : display_name,
"host" : host,
})
if iport>0:
desc["port"] = iport
if port>0:
desc["port"] = port
return desc
elif sys.platform.startswith("win") or display_name.startswith("named-pipe:"):
pipe_name = display_name
Expand Down

0 comments on commit 32e8699

Please sign in to comment.