diff --git a/static/js/pad2.js b/static/js/pad2.js index 24aa182b2..7f9d3a73a 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 2c369b366..84f93681d 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});