Servidor Echo WebSocket

Mostre como escrever um aplicativo simples de servidor WebSocket.

Este servidor Echo mostra como criar um aplicativo de servidor simples que envia uma resposta à mensagem recebida, utilizando a API WebSocket. Para fins ilustrativos, a resposta é simplesmente uma cópia da mensagem.

Se o seu navegador da web for compatível com WebSocket, você também pode usá-lo para abrir o arquivo echoserver/echoclient.html{echoclient.html} e operar conforme mostrado na captura de tela a seguir:

Cliente HTML do WebSocket Echo

Caso contrário, use o WebSocket Echo Client para se conectar ao servidor.

Projeto de exemplo em code.qt.io

Veja também Cliente Echo do WebSocket.

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