测试wss是否连接企业微信成功

时间:2019-10-30 10:31:09   收藏:0   阅读:195
<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>

 企业微信考勤机无法连接服务器,可以尝试用上面代码保存为html测试一下网络。

测试连接微信wss://openhw.work.weixin.qq.com:443
 
评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!