Socket.io works perfectly on every platform except IE8 and 9, which is a client requirement. could you guys help with this issue?
i've been reading all similar issues but most of the solutions i found till now can't solve this problem on IE8.
here's the structure:
SERVER-SIDE
var ip = 'xxx.xxx.xxx.xxx';
var ipPort = '8081';
var app = require('http').createServer(handler);
var io = require('socket.io')(app);
var fs = require('fs')
app.listen(ipPort, function() {
//console.log('Listening at: http://'+ ip +':'+ ipPort +'');
});
//io.set('transports', ['websocket','flashsocket', 'htmlfile', 'xhr-polling', 'jsonp-polling']);
function handler (req, res) {
fs.readFile(__dirname + '/test.html',
function (err, data) {
if (err) {
res.writeHead(500);
return res.end('Error loading index.html');
}
res.writeHead(200);
res.end(data);
});
}
CLIENT-SIDE
<html>
<body>
</body>
<script src="/socket.io/socket.io.js"></script>
<script>
alert("hi");
//var socket = io.connect('xxx.xxx.xxx.xxx:8081',{transports:'jsonp-polling');
var socket = io.connect(''xxx.xxx.xxx.xxx:8081',{secure: true});
socket.on('news', function (data) {
alert("hello data:"+data[0]);
socket.emit('my other event', { my: data });
});
socket.on('connect', function () {
alert("hello socket");
});
</script>
</html>
i get no errors at all, just no response.. i placed an alert() on socket.on('news') and doesn't get any feedback, BUT THEN i added socket.on('connect') and placed the alert() inside and it pops up!!
hope there's someone out there that pass through this issue before and solve it. I'm on win7 and node(v0.10.30) socket.io(v1.0.6) thanks very much for all the help.