I need an help: I am trying to send an emit socket event to the server side. Could you please help me to find out the error ? Please consider the enviroment : client files and server files are running on the same server.
AngularJS:
<!-- Socket.io //bower_components/angular-socket-io/mock/socket-io.js-->
var socket = io.connect("http://127.0.0.1:3000");
socket.emit("test","{'xxx': 'yyy'}");
NodeJs:
//"socket.io": "^1.7.4",
var io = require('socket.io').listen(3000);
io.sockets.on('connection', function (socket) {
socket.on('test', function (data) {
console.log("receiving data: " , data);
});
)}
running with : nodemon push.js 3000
Thanks in advance. Andrea