Skip to content

youngmonkeys/ezyfox-server-es6-client

Repository files navigation

ezyfox-server-es6-client

javascript emacs 6 client for ezyfox server

Synopsis

javascript emacs 6 client for ezyfox server

Documentation

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

Installation

npm i ezyfox-es6-client

Code Example

You can find the full example here

1. Create ws client

var config = new Ezy.ClientConfig;
config.zoneName = "zoneName";
var clients = Ezy.Clients.getInstance();
var client = clients.newDefaultClient(config);

2. Setup ws client

var setup = client.setup;
setup.addEventHandler(Ezy.EventType.DISCONNECTION, disconnectionHandler);
setup.addDataHandler(Ezy.Command.HANDSHAKE, handshakeHandler);
setup.addDataHandler(Ezy.Command.LOGIN, userLoginHandler);
setup.addDataHandler(Ezy.Command.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");

Used By

  1. Freechat

Tutorials

  1. EzyChat with ReactJS

Contact us

License

Apache License, Version 2.0