5.1 – Reporting API (query server status, client side JavaScript API)
Include "gateway.js" in your web page:
var gw = new Gateway("192.168.9.118");
gw.login("password");
gw.report(); //output to console
gw.report(callback); //output to callback method
gw.checkLicense(callback2); //check license status
function callback(obj) {
if (obj.error) {
console.log("Error on getting report:" + obj.error);
return;
}
var c, cs = obj.connections;
var len = cs.length;
console.log("\nTotal connections:" + len);
for ( var i = 0; i < len; i++) {
c = cs[i];
console.log("connection " + i + " ------");
console.log("clientIp: " + c.clientIp);
console.log("clientAgent: " + c.clientAgent);
console.log("server: " + c.server);
console.log("startTime: " + c.startTime);
}
}
We also have a Java command line tool available for the same purpose. Please download it from our website.
We also have WebSocket client available which can be used to communicate with our gateway or other WebSocket servers.