javascript client for ezyfox server
javascript client for ezyfox server
https://youngmonkeys.org/ezyfox-javascript-client-sdk
You can find the full example here
1. Create ws client
var config = new EzyClientConfig;
config.zoneName = "zoneName";
var clients = EzyClients.getInstance();
var client = clients.newDefaultClient(config);
2. Setup ws client*
var setup = client.setup;
setup.addEventHandler(EzyEventType.DISCONNECTION, disconnectionHandler);
setup.addDataHandler(EzyCommand.HANDSHAKE, handshakeHandler);
setup.addDataHandler(EzyCommand.LOGIN, userLoginHandler);
setup.addDataHandler(EzyCommand.APP_ACCESS, accessAppHandler);
var setupApp = setup.setupApp("appName");
setupApp.addDataHandler("command", function(app, data) {
controller.contactController.handleSuggestedContactsResponse(data);
});
3. Connect to server
client.connect("ws://localhost:2208/ws");
You can download latest version from bin folder, add the latest version file to you project and import to your html file:
<script src="ezyclient-1.0.3.min.js"></script>