Detect connection type before etablishing the socket connection, should solve a problem with a https proxy in front

This commit is contained in:
Peter 'Pita' Martischka 2011-05-23 19:29:39 +01:00
parent 6d6837a374
commit 3cef5e4b23
1 changed files with 5 additions and 1 deletions

View File

@ -60,7 +60,11 @@ function randomString() {
function handshake()
{
socket = new io.Socket();
var host = window.location.hostname;
var options = {secure: window.location.protocol == 'https:',
port: window.location.port};
socket = new io.Socket(host, options);
socket.connect();
socket.on('connect', function(){