From 3cef5e4b232c127f12d35b77192c1f7192260405 Mon Sep 17 00:00:00 2001 From: Peter 'Pita' Martischka Date: Mon, 23 May 2011 19:29:39 +0100 Subject: [PATCH] Detect connection type before etablishing the socket connection, should solve a problem with a https proxy in front --- static/js/pad2.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/static/js/pad2.js b/static/js/pad2.js index fa3504483..50bd9459d 100644 --- a/static/js/pad2.js +++ b/static/js/pad2.js @@ -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(){