I wanna deploy my server to Heroku, currently Heroku only supports XHR Polling so I have to configure my server use XHR Polling instead of Websocket.
I've tested in local, my server runs well with Websocket but not with XHR Polling:
io.sockets.on('connection', function (socket) {
socket.emit('connected', socket.id); // <-- this works
socket.on('join', function (nickname) { // <-- this also works
console.log(nickname, 'request joined');
socket.emit('join', true); // <-- this doesn't work,
//client doesn't receive message
});
I wanna deploy my server to Heroku, currently Heroku only supports XHR Polling so I have to configure my server use XHR Polling instead of Websocket.
I've tested in local, my server runs well with Websocket but not with XHR Polling:
Maybe it's some problems with XHR Transport