Skip to content

Commit

Permalink
Host socket.io locally
Browse files Browse the repository at this point in the history
Total hack to nowjs
  • Loading branch information
FirstVertex committed Sep 29, 2012
1 parent 9c36e8e commit 0f994d5
Show file tree
Hide file tree
Showing 2 changed files with 3,247 additions and 2 deletions.
7 changes: 5 additions & 2 deletions client/lib/now.js
Expand Up @@ -384,7 +384,8 @@
};
var dependencies = [{
key: "io",
path: "/" + now.core.options.socketio.resource + "/socket.io.js"
// hack: host socket.io locally
path: "/lib/socket.io.js"
}],
dependenciesLoaded = 0,
scriptLoaded = function () {
Expand Down Expand Up @@ -421,7 +422,9 @@
}
var fileref = document.createElement("script");
fileref.setAttribute("type", "text/javascript");
fileref.setAttribute("src", uri + dependencies[i].path);
// hack: host socket.io locally
var endUri = dependencies[i].key === "io" ? "" : uri;
fileref.setAttribute("src", endUri + dependencies[i].path);
fileref.onload = scriptLoaded;
isIE && (fileref.onreadystatechange = function () {
(fileref.readyState === "loaded" || fileref.readyState === "complete") && scriptLoaded()
Expand Down

0 comments on commit 0f994d5

Please sign in to comment.