Permalink
Browse files

Host socket.io locally

Total hack to nowjs
  • Loading branch information...
hughanderson4 committed Sep 29, 2012
1 parent 9c36e8e commit 0f994d5f827c1502fd2f8bb96a33ccb268558b8a
Showing with 3,247 additions and 2 deletions.
  1. +5 −2 client/lib/now.js
  2. +3,242 −0 client/lib/socket.io.js
View
@@ -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 () {
@@ -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()
Oops, something went wrong.

0 comments on commit 0f994d5

Please sign in to comment.