安全的 WebSocket 回显客户端

一个使用安全 WebSocket(wss)的简单客户端应用程序。

“安全 WebSocket 回显客户端”示例演示了如何使用WebSocket类通过安全连接(wss)实现回显客户端。它会连接到服务器并发送一条消息;当收到返回的消息时,会将其打印出来并退出。此示例需要支持 SSL 才能运行。

该示例默认通过安全连接连接到 localhost 的 1234 端口。它信任由 SSL 后端中配置的 CA 证书所签名的证书,同时还信任“安全 WebSocket 回显服务器”所使用的证书。

安全的 WebSocket 回显控制台客户端

示例项目 @ code.qt.io

另请参阅 WebSocket 回显客户端和安全 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.