-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Description
I have successfully implemented socket.io, node.js and express to server realtime json data to all browsers except IE (testing on 9) using a secure connection. This worked fine everywhere until I moved it behind https. From the server console output, it shows that an event is received when called from IE:
xhr-polling received data packet 5:::{"name":"lookup_place","args":
[{"place":"Berlin"}]}
However, no response is given and the next 4 lines shown in the console are:
clearing poll timeout
xhr-polling writing 8::
set close timeout for client 27081179790885432
xhr-polling closed due to exceeded duration
When the same is done from FF or Chrome, the line "xhr-polling writing 8::" is appended with the correct response, for example:
xhr-polling writing 5:::{"name":"place_results","args":[{"a":
[{"identifier":"52156","value":"Monschau, 52156"},
{"identifier":"67590","value":"Monsheim, 67590"},
{"identifier":"04617","value":"Monstab, 04617"}]}]}
I am using node.js version 0.4.10, socket.io version 0.7.7 and express version 2.4.3. The same scripts worked perfectly fine in IE 7-9 without an https/ssl/secure connection.
Any help would be greatly appreciated in discovering why no response is delivered in IE but works fine in all others.
Activity
editstudio commentedon Aug 9, 2011
For more details, you can have a look at the source here: https://gist.github.com/1134193
No magic happening in the server, and the client_snippet.js is just a function that registers the socket events, there is no other socket.io related code in the file but if someone would like the the full script to try and replicate it with their own key/crt let me know and i will send it to you.
Thanks again!
Pita commentedon Aug 9, 2011
are you using a reverse proxy? Or how do you add https?
editstudio commentedon Aug 10, 2011
No reverse proxy, just a https server on port 3000 (and express has been removed) providing options as per doc description.
server = https.createServer(options, function (req, res) {
res.writeHead(200);
res.end("hello world\n");
});
io = io.listen(server);
server.listen(process.argv[2]);
Where options, is a dictionary with values for the key, crt and ca file and on the client side secure:true is set on the Socket instance. The setup worked wonders without a secure connection across all browsers however in IE9, with https, no data is emitted to the client but the data is received.
For example:
socket.on('lookup_place', function(data){
console.log('This is output in the log.',data);
socket.emit('place_results',{a:matching_places(data.place)});
});
Output the log message but appears that the socket.emit times out.
editstudio commentedon Sep 5, 2011
Do not know what exactly happened in the code base since version 0.7.7 till 0.8.2 but the issue no longer comes up.
Thanks!
[fix] Don't delete ws when closing the server (#444)