index.js 484 Bytes
Newer Older
Alexander Bazo committed
1 2 3 4 5
/* eslint-env browser */
/* global GazeClient */

var gclient = new GazeClient();
gclient.connect("ws://localhost:8001/gaze");
Alexander Bazo committed
6
gclient.addEventListener("connectionopened", onConnected);
7
gclient.addEventListener("dataavailable", onGazeDataAvailable);
Alexander Bazo committed
8 9 10 11 12
gclient.addEventListener("connectionclosed", onDisconnected);

function onConnected(event) {
	console.log(event);
}
13 14 15

function onGazeDataAvailable(event) {
	console.log(event);
Alexander Bazo committed
16 17 18 19
}

function onDisconnected(event) {
	console.log(event);
20
}