Closed czajah closed 13 years ago
Couple of things that you'll need to change manually for this to work:
Line 434:
socket = new io.Socket('**SERVER**', {port: **PORT**, secure: true});
Line 453:
fileref.setAttribute("src", "//**SERVER**:**PORT**"+dependencies[i]['path']);
which file?
now.js
ok, its something like this:
socket = new io.Socket('**SERVER**', {port: **PORT**,secure:"https"==scheme});
and
fileref.setAttribute("src", scheme+"://**SERVER**:**PORT**"+dependencies[i]['path']);
is there better way to obtain scheme/protocol name than
var scheme = function()
{
var scripts = document.getElementsByTagName( 'script' );
var srcUrlString = scripts[ scripts.length -1 ].src;
// http://labs.apache.org/webarch/uri/rfc/rfc3986.html#regexp
var urlParser = /^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;
var splitResult = srcUrlString.split(urlParser);
return splitResult[2];
}();
?
The first part is good. The second part should just be what I said before. Don't bother trying to make some complicated regex that handles everything for you.
wow, i see :) lol
thank you
I'm including now.js this way:
<script type="text/javascript" src="HTTPS://localhost:3000/nowjs/now.js"></script>
and it is ok but a problem is with automagic including socket.io.js because it is accessed via HTTP:
(The page at HTTPS://localhost:3000/szop ran insecure content from HTTP://localhost:3000/socket.io/socket.io.js.)
so GET http://localhost:3000/socket.io/socket.io.js fails.