ウェブソケット・エコー・サーバー

シンプルなWebSocketサーバーアプリケーションの書き方を紹介します。

この Echo Server は、WebSocketAPI を使用して、受信したメッセージに対する応答を返送するシンプルなサーバーアプリケーションの作成方法を示します。説明のために、返信は単にメッセージのコピーです。

ウェブブラウザがWebSocket をサポートしている場合は、echoserver/echoclient.html{echoclient.html} ファイルを開き、次のスクリーンショットのように操作することもできます:

WebSocket Echo HTML Client

それ以外の場合は、WebSocket Echo Clientを使用してサーバーに接続します。

サンプルプロジェクト @ code.qt.io

WebSocket Echo Clientも参照してください

© 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.