June 2015
Beginner to intermediate
186 pages
4h 1m
English
In a typical web application, the server will need a way to identify between connected clients. Most applications today use the one-identity rule and have each user login to a respective string-based identifier known as their username. We will also be using the same rule in our signaling application. It will not be as sophisticated as some of the methods used today since we will not even require a password from the user. We simply need an ID for each connection so we know where to send messages.
To start, we are going to change our connection handler a bit, to look similar to this:
connection.on(''message'', function (message) { var data; try { data = JSON.parse(message); } catch (e) { console.log(""Error parsing JSON""); data ...Read now
Unlock full access