Cliente WebSocket Echo
Muestra cómo escribir una sencilla aplicación cliente WebSocket.
El cliente Echo muestra cómo utilizar la API de WebSocket para enviar un mensaje a un servidor y procesar cualquier respuesta que este devuelva; en este caso, simplemente muestra la respuesta.
Por defecto, el cliente abre una conexión WebSocket con un servidor que escucha en el puerto local 1234. Cuando el intento de conexión se realiza con éxito, el cliente envía un mensaje al servidor y muestra en pantalla la respuesta que este envía. A continuación, el cliente cierra la conexión.

A modo de ejemplo, utilizamos el servidor WebSocket Echo, cuya respuesta es simplemente el mensaje que se envió.
Véase también «Servidor de eco 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.