diff options
Diffstat (limited to 'src/widgets/direct_connect_dialog.cpp')
| -rw-r--r-- | src/widgets/direct_connect_dialog.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/widgets/direct_connect_dialog.cpp b/src/widgets/direct_connect_dialog.cpp index f8c77b85..9859889d 100644 --- a/src/widgets/direct_connect_dialog.cpp +++ b/src/widgets/direct_connect_dialog.cpp @@ -51,7 +51,7 @@ void DirectConnectDialog::onConnectPressed() QString l_hostname = ui_direct_hostname_edit->text(); if (!SCHEME_PATTERN.match(l_hostname).hasMatch()) { - l_hostname = "ws://" % l_hostname; + l_hostname = "wss://" % l_hostname; } QUrl l_url(l_hostname); @@ -61,20 +61,21 @@ void DirectConnectDialog::onConnectPressed() return; } - if (l_url.scheme() != "ws") + if (l_url.scheme() != "ws" && l_url.scheme() != "wss") { - call_error(tr("Invalid URL scheme. Only ws:// is supported.")); + call_error(tr("Invalid URL scheme. Only ws: and wss: are supported.")); return; } - if (l_url.port() == -1) + int port = l_url.port(); + if (port == -1) { - call_error(tr("Invalid server port.")); - return; + port = (l_url.scheme() == "wss") ? 443 : 80; } ServerInfo l_server; l_server.address = l_url.host(); - l_server.port = l_url.port(); + l_server.port = port; + l_server.scheme = l_url.scheme(); l_server.name = "Direct Connection"; net_manager->connect_to_server(l_server); |
