mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-05-10 14:58:27 +00:00
backup index page
This commit is contained in:
parent
cd85d66326
commit
157e478abb
@ -49,17 +49,18 @@ function wsServer(config){
|
|||||||
//web socket interface
|
//web socket interface
|
||||||
var wss = new WebSocketServer({port: config.port});
|
var wss = new WebSocketServer({port: config.port});
|
||||||
wss.broadcast = function(data) {
|
wss.broadcast = function(data) {
|
||||||
if(typeof data == "object"){
|
var key = data.id;
|
||||||
data = JSON.stringify(data);
|
if(typeof data == "object"){
|
||||||
}
|
data = JSON.stringify(data);
|
||||||
|
}
|
||||||
|
|
||||||
for(var i in this.clients){
|
for(var i in this.clients){
|
||||||
try{
|
try{
|
||||||
this.clients[i].send(data);
|
this.clients[i].send(data);
|
||||||
}catch(e){
|
}catch(e){
|
||||||
logUtil.printLog("websocket failed to send data, " + e, logUtil.T_ERR);
|
logUtil.printLog("websocket failed to send data, " + e, logUtil.T_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
wss.on("connection",function(ws){
|
wss.on("connection",function(ws){
|
||||||
@ -78,6 +79,7 @@ function wsServer(config){
|
|||||||
type : "update",
|
type : "update",
|
||||||
content: data
|
content: data
|
||||||
});
|
});
|
||||||
|
|
||||||
}catch(e){
|
}catch(e){
|
||||||
console.log("ws error");
|
console.log("ws error");
|
||||||
console.log(e);
|
console.log(e);
|
||||||
|
@ -34,7 +34,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="clear:both"></div>
|
<div style="clear:both"></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mainTableWrapper" id="J_content"></div>
|
<div class="mainTableWrapper" id="J_content"></div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user