Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Enable users to specify protocol.

  • Loading branch information...
commit 755dea0c5f6f0f4b56c43571c00795f2b568b0ad 1 parent 892fc96
@steveWang steveWang authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/fileServer.js
View
6 lib/fileServer.js
@@ -97,9 +97,11 @@ serveFile = function (filename, request, response, options) {
generateClientLibs = function (hostServer, hostPort, callback) {
fs.readFile(__dirname + '/client/now.js', function (err, data) {
var nowText = data.toString();
- var initString = options.scope + '.now = nowInitialize("//'+ hostServer + ':' + hostPort + '", ' + options.client + ');\n';
+ var initString = options.scope + '.now = nowInitialize("' +
+ (options.protocol !== undefined ? options.protocol + ':' : '') +
+ '//' + hostServer + ':' + hostPort + '", ' + options.client + ');\n';
nowText += initString;
-
+
callback(nowText);
});
};
Please sign in to comment.
Something went wrong with that request. Please try again.