chat part working quite seemlessly with heroku server and database
- fixed many issues with keeping connection alive, avatars, userId, etc.
This commit is contained in:
+13
-4
@@ -4,10 +4,10 @@ var io = require('socket.io')(server);
|
||||
var mysql = require('mysql');
|
||||
|
||||
var con = mysql.createConnection({
|
||||
host: 'localhost',
|
||||
user: 'root',
|
||||
password: 'mysql',
|
||||
database: 'nexto'
|
||||
host: 'us-cdbr-iron-east-04.cleardb.net',
|
||||
user: 'bc7fa7fdf1822b',
|
||||
password: 'f62b55b3',
|
||||
database: 'heroku_99e764eb3c2ab7e'
|
||||
});
|
||||
|
||||
var port = 3000;
|
||||
@@ -61,4 +61,13 @@ io.on('connection', function (socket) {
|
||||
socket.on('disconnect', function() {
|
||||
console.log('Client disconnected: ' + socket.id);
|
||||
});
|
||||
|
||||
connection.on('error', function (err) {
|
||||
if (!err.fatal) {
|
||||
return;
|
||||
}
|
||||
if (err.code !== 'PROTOCOL_CONNECTION_LOST') {
|
||||
throw err;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user