From ac1858f8ec7ca132f3c2ef6c4fd3f1720844b4ff Mon Sep 17 00:00:00 2001 From: Peter 'Pita' Martischka Date: Wed, 6 Jul 2011 19:51:41 +0200 Subject: [PATCH] Fixes a problem with the resource path of socket.io --- static/js/pad2.js | 5 +++-- static/timeslider.html | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/static/js/pad2.js b/static/js/pad2.js index 24aa182b..7f9d3a73 100644 --- a/static/js/pad2.js +++ b/static/js/pad2.js @@ -66,8 +66,9 @@ function handshake() //create the url var url = loc.protocol + "//" + loc.hostname + ":" + port + "/"; //find out in which subfolder we are - var resource = loc.pathname.substring(0,loc.pathname.indexOf("/p/")) + "/socket.io"; - + console.log(loc.pathname); + var resource = loc.pathname.substr(1,loc.pathname.indexOf("/p/")) + "socket.io"; + console.log(resource); //connect socket = io.connect(url, {resource: resource}); diff --git a/static/timeslider.html b/static/timeslider.html index 2c369b36..84f93681 100644 --- a/static/timeslider.html +++ b/static/timeslider.html @@ -75,7 +75,7 @@ //create the url var url = loc.protocol + "//" + loc.hostname + ":" + port + "/"; //find out in which subfolder we are - var resource = loc.pathname.substring(0,loc.pathname.indexOf("/p/")) + "/socket.io"; + var resource = loc.pathname.substr(1,loc.pathname.indexOf("/p/")) + "socket.io"; //build up the socket io connection socket = io.connect(url, {resource: resource});