diff options
| author | Osmium Sorcerer <os@sof.beauty> | 2026-03-22 17:57:13 +0000 |
|---|---|---|
| committer | Osmium Sorcerer <os@sof.beauty> | 2026-03-29 22:22:25 +0000 |
| commit | 79c2262cae02b513aee70943f7e07a9205316bdf (patch) | |
| tree | 02efb824bad180a11bd1b68c41508088c167434b /src/network | |
| parent | 06f34c776972542222623ca4f91880de97993fbf (diff) | |
Support Secure WebSocket
Add full WSS support to public server list (using wss_port, overriding
insecure port), favorite servers list, and direct connections, and show
which servers are secure.
Revert the upstream's removal of `legacy` ServerInfo field, as I use it
to filter out legacy servers. To differentiate schemes, the `scheme`
field is used, either "ws" or "wss". I don't see the reason to add "tcp"
protocol when we don't even support it.
For the UI, add icons for secure and insecure connections. Highlight
secure servers with a green background.
In the favorite server dialog, a checkbox was added to select whether
the server is using WSS.
In the direct connection dialog, support "wss" scheme and default ports:
80 for WS, 443 for WSS, as per the WebSocket specification.
Diffstat (limited to 'src/network')
| -rw-r--r-- | src/network/serverinfo.h | 3 | ||||
| -rw-r--r-- | src/network/websocketconnection.cpp | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/network/serverinfo.h b/src/network/serverinfo.h index de91a011..b7e00697 100644 --- a/src/network/serverinfo.h +++ b/src/network/serverinfo.h @@ -9,7 +9,8 @@ public: QString description; QString address; quint16 port = 0; - QString protocol = "ws"; + bool legacy = false; + QString scheme = "ws"; QString toString() const; }; diff --git a/src/network/websocketconnection.cpp b/src/network/websocketconnection.cpp index e9cc1ef9..d51cdcaf 100644 --- a/src/network/websocketconnection.cpp +++ b/src/network/websocketconnection.cpp @@ -32,7 +32,7 @@ void WebSocketConnection::connectToServer(const ServerInfo &server) disconnectFromServer(); QUrl url; - url.setScheme(server.protocol); + url.setScheme(server.scheme); url.setHost(server.address); url.setPort(server.port); |
