socketcluster.js前端写法接受后端信息。

来源:互联网 发布:云计算 国家政策汇总 编辑:程序博客网 时间:2024/05/01 09:05
var socket = socketCluster.connect({
port: 80,
//hostname: "xxx.xxx.xxx.xxx",
hostname: "xxx.xxx.xxx.xxx",
//path: '/private-cloud-service',
path: '/rssec/scservice',
secure: false

});

var sub1 = socket.subscribe(`${machId}-counters-system-cpu`);
sub1.watch(function(data) {
取到消息

});

原创粉丝点击