Azure + Socket IO raises 404 error

NodeJS and socket.io seem to work fine, but when inspecting the logs, I see an HTTP Error 404.0 - Not Found, which I can't figure out why this is happening. For example my full url where nodejs is hosted is sample-nodejs.azurewebsites.net and I get the following error:

error 404

Update with more information:

I've tried different combinations of server setup (using or not expressing) but I always get the same result. I am initializing my server like this:

var http = require('http');
const PORT = process.env.PORT || 1337;
var server = http.createServer();
var io = require('socket.io')(server);
server.listen(PORT);

io.sockets.on('connection', function(socket)
{
   ...
});

      

I have used socket.io 1.7.4 through the current latest 2.0.3. and I am getting the same problem. Client debugging seems fine, but error checking from the azure "log stream" I see randomly (did not implement the template) HTTP 404.0 - Not Found Errors and requests url from https: // sample-nodejs: 80 / socket.io /? EIO = 3 & transport = polling & a ..

Is the URL strange since the full path for the server is sample-nodejs.azurewebsites.net?

+3


source to share





All Articles