diff --git a/lib/client/api.js b/lib/client/api.js index e89d54b..9d8eae5 100644 --- a/lib/client/api.js +++ b/lib/client/api.js @@ -1,3 +1,12 @@ -Cluster.discoverConnection = function(serviceName) { - return DDP.connect("/" + serviceName); +Cluster.discoverConnection = function(serviceName, ddpOptions) { + var url; + + // use Meteor.absoluteUrl() to construct url by default, just for supporting cordova. + if (!ddpOptions || ddpOptions.useAbsoluteUrl) { + url = Meteor.absoluteUrl(serviceName); + } else { + url = "/" + serviceName; + } + + return DDP.connect(url); }; \ No newline at end of file diff --git a/package.js b/package.js index 0ebe993..68234e4 100644 --- a/package.js +++ b/package.js @@ -1,6 +1,6 @@ Package.describe({ "summary": "Clustering solution for Meteor with load balancing and service discovery.", - "version": "1.6.9", + "version": "1.7.0", "git": "https://github.com/meteorhacks/cluster.git", "name": "meteorhacks:cluster" }); @@ -17,6 +17,8 @@ Npm.depends({ Package.onTest(function(api) { configurePackage(api); api.use('tinytest'); + api.use('mongo'); + api.use('random'); api.use('practicalmeteor:sinon@1.10.3_2'); api.addFiles([