Fixes a problem with the resource path of socket.io
parent
068d174c58
commit
ac1858f8ec
|
@ -66,8 +66,9 @@ function handshake()
|
||||||
//create the url
|
//create the url
|
||||||
var url = loc.protocol + "//" + loc.hostname + ":" + port + "/";
|
var url = loc.protocol + "//" + loc.hostname + ":" + port + "/";
|
||||||
//find out in which subfolder we are
|
//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
|
//connect
|
||||||
socket = io.connect(url, {resource: resource});
|
socket = io.connect(url, {resource: resource});
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@
|
||||||
//create the url
|
//create the url
|
||||||
var url = loc.protocol + "//" + loc.hostname + ":" + port + "/";
|
var url = loc.protocol + "//" + loc.hostname + ":" + port + "/";
|
||||||
//find out in which subfolder we are
|
//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
|
//build up the socket io connection
|
||||||
socket = io.connect(url, {resource: resource});
|
socket = io.connect(url, {resource: resource});
|
||||||
|
|
Loading…
Reference in New Issue