本页内容

测试Qt WebSockets

Autobahn|Testsuite 是 WebSocket 协议(RFC 6455)的标准测试套件,可用于测试Qt WebSockets 的符合性。请参阅Autobahn|Testsuite 安装文档以设置该测试套件。

使用 Autobahn|Testsuite 测试Qt WebSockets

wstest - fuzzingserver 模式

cd your_build_dir/tests/manual/compliance
qmake your_src_dir/tests/manual/compliance/compliance.pro
make

cd ~
wstest -m fuzzingserver

然后,在另一个终端中:

cd your_build_dir/tests/manual/compliance
./tst_compliance

测试结果将生成在 ~/reports/clients 目录下。请在浏览器中访问 ~/reports/clients/index.html。

wstest - 模糊测试客户端模式

cd your_build_dir/examples/websockets/echoserver
qmake your_src_dir/examples/websockets/echoserver/echoserver.pro
make

./echoserver -p 9001

然后,在另一个终端中:

cd ~
wstest -m fuzzingclient

测试结果将生成在 ~/reports/servers 目录下。请在浏览器中访问 ~/reports/servers/index.html。

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