Skip to content

Commit

Permalink
#3376 stub client quic connection
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Nov 5, 2022
1 parent 8d9fd5f commit 8e8ac46
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
14 changes: 9 additions & 5 deletions xpra/scripts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def run_mode(script_file, cmdline, error_cb, options, args, mode, defaults):
warn("\nWarning: running as root")

mode = MODE_ALIAS.get(mode, mode)
display_is_remote = isdisplaytype(args, "ssh", "tcp", "ssl", "vsock")
display_is_remote = isdisplaytype(args, "ssh", "tcp", "ssl", "vsock", "quic")
if mode=="shadow" and WIN32 and not envbool("XPRA_PAEXEC_WRAP", False):
#are we started from a non-interactive context?
from xpra.platform.win32.gui import get_desktop_name
Expand Down Expand Up @@ -455,7 +455,7 @@ def run_mode(script_file, cmdline, error_cb, options, args, mode, defaults):

def do_run_mode(script_file, cmdline, error_cb, options, args, mode, defaults):
mode = MODE_ALIAS.get(mode, mode)
display_is_remote = isdisplaytype(args, "ssh", "tcp", "ssl", "vsock")
display_is_remote = isdisplaytype(args, "ssh", "tcp", "ssl", "vsock", "quic")
if mode in ("seamless", "desktop", "monitor", "expand", "shadow") and display_is_remote:
#ie: "xpra start ssh://USER@HOST:SSHPORT/DISPLAY --start-child=xterm"
return run_remote_server(script_file, cmdline, error_cb, options, args, mode, defaults)
Expand Down Expand Up @@ -742,7 +742,7 @@ def display_desc_to_uri(display_desc):
uri += ":"+password
if username is not None or password is not None:
uri += "@"
if dtype in ("ssh", "tcp", "ssl", "ws", "wss"):
if dtype in ("ssh", "tcp", "ssl", "ws", "wss", "quic"):
#TODO: re-add 'proxy_host' arguments here
host = display_desc.get("host")
if not host:
Expand Down Expand Up @@ -1060,9 +1060,13 @@ def sockpathfail_cb(msg):
)
return conn

if dtype=="quic":
sock = retry_socket_connect(display_desc)
sock.settimeout(None)
from xpra.net.quic import QUIC_Connection
return QUIC_Connection(sock)

if dtype in ("tcp", "ssl", "ws", "wss", "vnc"):
host = display_desc["host"]
port = display_desc["port"]
sock = retry_socket_connect(display_desc)
sock.settimeout(None)
conn = SocketConnection(sock, sock.getsockname(), sock.getpeername(), display_name,
Expand Down
4 changes: 2 additions & 2 deletions xpra/scripts/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,12 +540,12 @@ def add_query():
opts.display = None
return desc

if protocol in ("tcp", "ssl", "ws", "wss", "vnc"):
if protocol in ("tcp", "ssl", "ws", "wss", "vnc", "quic"):
add_credentials()
host, port = add_host_port(DEFAULT_PORTS.get(protocol, DEFAULT_PORT))
add_path()
add_query()
if protocol in ("ssl", "wss"):
if protocol in ("ssl", "wss", "quic"):
desc["ssl-options"] = get_ssl_options(desc, opts, cmdline)
proxy = desc.get("proxy")
if proxy=="auto":
Expand Down
1 change: 1 addition & 0 deletions xpra/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"ssh" : 22,
"tcp" : DEFAULT_PORT,
"vnc" : 5900,
"quic" : 20000,
}


Expand Down

0 comments on commit 8e8ac46

Please sign in to comment.