summaryrefslogtreecommitdiff
path: root/examples/webchannel/nodejs/chatclient.js
diff options
context:
space:
mode:
Diffstat (limited to 'examples/webchannel/nodejs/chatclient.js')
-rw-r--r--examples/webchannel/nodejs/chatclient.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/examples/webchannel/nodejs/chatclient.js b/examples/webchannel/nodejs/chatclient.js
index 5e458f2..76b620c 100644
--- a/examples/webchannel/nodejs/chatclient.js
+++ b/examples/webchannel/nodejs/chatclient.js
@@ -91,7 +91,10 @@ var createWebChannel = function(transport, rlif) {
console.log(' << ' + message);
rlif.prompt();
// Go to end of existing input if any
- rlif.write(null, {ctrl: true, name: 'e'})
+ rlif.write(null, {
+ ctrl: true,
+ name: 'e'
+ })
});
rlif.on('line', function(line) {
@@ -118,7 +121,9 @@ socket.on('open', function(event) {
var transport = {
// We cant't do 'send: socket.send' here
// because 'send' wouldn't be bound to 'socket'
- send: function(data) {socket.send(data)}
+ send: function(data) {
+ socket.send(data)
+ }
};
createWebChannel(transport, createReadlineInterface());
@@ -131,12 +136,12 @@ socket.on('open', function(event) {
});
});
-socket.on('error', function (error) {
+socket.on('error', function(error) {
console.log('Connection error: ' + error.message);
process.exit(1);
});
-socket.on('close', function () {
+socket.on('close', function() {
console.log('Connection closed.');
process.exit(1);
});