I've got a socket.io v0.9.17 node js app deployed on azure (which I've tested locally with two clients and it works fine) with the following code:
var util = require("util");
var port = process.env.PORT || 1337;
var app = require("http").createServer(function (req, res) {
res.writeHead(200, { "Content-Type": "text/plain" });
res.end("Socket.io application");
}).listen(port);
var io = require('socket.io').listen(app);
io.configure(function () {
io.set("transports", ["websocket"]);
});
io.sockets.on('connection', function (client) { ... }
I try to connect to it through a socket.io-java-client with:
// Have tested with different ports
socket.connect("http://myapp.azurewebsites.net:1337/", this);
This give me error on the client:
Error while handshaking... Operation timed out
Logs on the server:
debug: websocket writing 1::
debug: setting request GET /socket.io/1/websocket/SFePun_Ug5ycS5EVIrSO
debug: set heartbeat interval for client SFePun_Ug5ycS5EVIrSO
debug: discarding transport
debug: cleared heartbeat interval for client SFePun_Ug5ycS5EVIrSO
debug: setting request GET /socket.io/1/websocket/SFePun_Ug5ycS5EVIrSO
debug: set heartbeat interval for client SFePun_Ug5ycS5EVIrSO
debug: discarding transport
debug: cleared heartbeat interval for client SFePun_Ug5ycS5EVIrSO
debug: setting request GET /socket.io/1/websocket/SFePun_Ug5ycS5EVIrSO
debug: set heartbeat interval for client SFePun_Ug5ycS5EVIrSO
debug: discarding transport
(repeated a couple of times)
...
IIS Detailed Error - 503.13 - Number of active WebSocket requests has reached the maximum concurrent WebSocket requests allowed.
socket.connect("http://myapp.azurewebsites.net/", this);
Which shouldn't happen if I connect one client.
Any ideas how to fix this?
EDIT: Tried to change from transport websocket to xhr-polling. This doesn't give me the HTTP 503.13 error and establishes connection to the server but it works poorly.