Fixes a problem with the resource path of socket.io

This commit is contained in:
Peter 'Pita' Martischka 2011-07-06 19:51:41 +02:00
parent 068d174c58
commit ac1858f8ec
2 changed files with 4 additions and 3 deletions

View file

@ -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});

View file

@ -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});