I am able to run my node.js server, my phaser.js game runs but I get no 'connected' console.log when the game runs. I instead get this error message from the client end:
socket.io-1.4.5.js:1 GET http://192.168.128.184:8080/socket.io/?EIO=3&transport=polling&t=LdMR6Ro net::ERR_CONNECTION_REFUSED
SERVER:
var serverPort = 8080;
console.log("Initializing Server.");
var express = require('express');
var connect = require('connect');
var app = express();
var serv = require('http').Server(app); //.createServer(app);
var io = require('socket.io').listen(serv); //(serv,{});
console.log("Starting Server.");
var serveStatic = require('serve-static');
connect().use(serveStatic(__dirname)).listen(serverPort, function(){
console.log('Server running on ' + serverPort + ' !');
});
app.get('/',function(req, res) {
res.sendFile(__dirname + '/index.html');
});
serv.listen(8081);
var SOCKET_LIST = {};
io.on('connection',function(socket){
console.log("A user is connected");
});
io.sockets.on('connection', function(socket){
console.log('Socket connection');
});
CLIENT
var local = "http://" + document.location.host + ":8081";
var socket = io().connect(local);