added websockets login

This commit is contained in:
cubedro
2015-02-26 23:45:24 +02:00
parent 9a266b527c
commit 28228c5cc4
4 changed files with 20 additions and 16 deletions

View File

@@ -74,7 +74,7 @@ function Node()
web3.setProvider(new web3.providers.HttpSyncProvider('http://' + (process.env.RPC_HOST || 'localhost') + ':' + (process.env.RPC_PORT || '8080')));
socket.on('open', function open() {
socket.emit('hello', { id: self.id, info: self.info});
socket.emit('hello', { id: self.id, info: self.info, secret: process.env.WS_SECRET });
console.log('The connection has been opened.');
}).on('end', function end() {
self._socket = false;
@@ -92,7 +92,7 @@ function Node()
self.sendUpdate(true);
console.log('The connection has been established.');
})
});
this.init();