セキュアウェブソケットエコーサーバー
セキュアな Web ソケット (wss) を介してクライアントに応答するシンプルなサーバです。
Secure WebSocket Echo Server の例では、QWebSocketServer クラスを使用して、セキュアソケット (wss) を介したシンプルなエコーサーバーを実装する方法を示します。この例を動作させるには、TLS のサポートが必要です。このサーバはクライアントとの認証を行い、成功するとクライアントからのメッセージを受け取り、それに応答します。説明の便宜上、応答は単に送られたメッセージのコピーである。
このサーバーは、自己署名証明書と鍵で設定されている。このサーバに接続するクライアントが、Secure WebSocket Echo Clientがその証明書を信頼するように構成されていない限り、クライアントはこのサーバを拒否します。
この例の一部として、HTMLベースのクライアントがあります。しかし、使用するブラウザが上記のように証明書をサポートしているか、localhostアドレスのTLSエラーを無視する場合にのみ動作します。
Secure WebSocket Echo ClientおよびWebSocket Echo Serverも参照してください 。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.