Skip to content

Commit

Permalink
Make it possible to override rtt.
Browse files Browse the repository at this point in the history
  • Loading branch information
majek committed Jan 16, 2012
1 parent fafd649 commit 5575615
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/sockjs.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
var SockJS = function(url, protocols_whitelist, options) {
var that = this;
that._options = {devel: false, debug: false, info: undefined};
that._options = {devel: false, debug: false, info: undefined, rtt: undefined};
if (options) {
utils.objectExtend(that._options, options);
}
that._base_url = utils.amendUrl(url);
that._server = that._options.server || utils.random_number_string(1000);
if (typeof protocols_whitelist === 'string') {
if (typeof protocols_whitelist === 'string' &&
protocols_whitelist.length > 0) {
protocols_whitelist = [protocols_whitelist];
} else if (!utils.isArray(protocols_whitelist)) {
protocols_whitelist = [];
protocols_whitelist = null;
}
that._protocols = [];
that.protocol = null;
Expand All @@ -21,6 +22,9 @@ var SockJS = function(url, protocols_whitelist, options) {
// Override if user supplies the option
info = that._options.info;
}
if (that._options.rtt) {
rtt = that._options.rtt;
}
that._applyInfo(info, rtt, protocols_whitelist);
that._didClose();
} else {
Expand Down

0 comments on commit 5575615

Please sign in to comment.