<html> <head> <title>測試wss</title> </head> <body> <div>測試鏈接微信wss://openhw.work.weixin.qq.com:443</div> <button onclick="test()">鏈接</button> <script> function test() { var ws=new WebSocket("wss://openhw.work.weixin.qq.com:443/"); ws.onopen = function(e) { alert('鏈接成功'); }; ws.onerror = function(e) { alert('鏈接失敗'); }; } </script> </body> </html>