commit
7ff504602b
9
app.js
9
app.js
@ -8,6 +8,8 @@ var Primus = require('primus'),
|
||||
api,
|
||||
client;
|
||||
|
||||
var WS_SECRET = process.env.WS_SECRET || "eth-net-stats-has-a-secret";
|
||||
|
||||
var Collection = require('./models/collection');
|
||||
var Nodes = new Collection();
|
||||
|
||||
@ -42,6 +44,13 @@ api.on('connection', function(spark) {
|
||||
console.log('got hello data from ', spark.id);
|
||||
console.log(data);
|
||||
|
||||
if(typeof data.secret === 'undefined' || data.secret !== WS_SECRET)
|
||||
{
|
||||
spark.end(undefined, { reconnect: false });
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(typeof data.id !== 'undefined' && typeof data.info !== 'undefined')
|
||||
{
|
||||
data.ip = spark.address.ip;
|
||||
|
5
public/js/lib/jquery.sparkline.min.js
vendored
Normal file
5
public/js/lib/jquery.sparkline.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user