youngmonkeys / ezyfox-server-js-client

ezyfox server javascript client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ezyfox-server-javascript-client

javascript client for ezyfox server

Synopsis

javascript client for ezyfox server

Documentation

https://youngmonkeys.org/ezyfox-javascript-client-sdk

Code Example

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");

Installation

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>

About

ezyfox server javascript client


Languages

Language:JavaScript 98.0%Language:HTML 2.0%