I am using socket.io for a windows azure project. Strangely the socket.io server starts when i just deploy the web role but when i deploy the whole cloud project, the socket.io server doesnt start and i get this error -
"SCRIPT7002: XMLHttpRequest: Network Error 0x2efd, Could not complete the operation due to error 00002efd."
I have absolutely no idea what that means. Can anyone help me out on this one? I have been banging my head about it all day.
SocketClient.html
<script>
var socket = io.connect('http://127.0.0.1:4001');
socket.on('news', function (data) {
console.log(data);
});
$(function () {
$("#sendresponse").bind("click", function () {
socket.emit('server', 'Hello World');
});
}
);
</script>
App.js
var app = require('express')(), server = require('http').createServer(app), io = require('socket.io').listen(server);
server.listen(4001);
app.get('/', function (req, res) {
res.sendfile(__dirname + '/index.html');
});
io.sockets.on('connection', function (socket) {
socket.emit('news', { hello: 'first time connect' });
socket.on('server', function (data) {
console.log(data);
socket.emit('news',"hello");
});
});