Skip to content

Commit

Permalink
#67 - move default options to a separate function
Browse files Browse the repository at this point in the history
  • Loading branch information
majek committed Jun 6, 2012
1 parent 4ad8906 commit d304518
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 1 addition & 5 deletions lib/sockjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@

var SockJS = function(url, dep_protocols_whitelist, options) {
var that = this, protocols_whitelist;
that._options = {devel: false,
debug: false,
protocols_whitelist: [],
info: undefined,
rtt: undefined};
that._options = utils.defaultOptions();
if (options) {
utils.objectExtend(that._options, options);
}
Expand Down
10 changes: 10 additions & 0 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,3 +323,13 @@ utils.detectProtocols = function(probed, protocols_whitelist, info) {
}
return protocols;
}

utils.defaultOptions = function(){
return {devel: false,
debug: false,
protocols_whitelist: [],
info: undefined,
rtt: undefined,
max_window_time: 4000,
init_window_size: 4096};
}

0 comments on commit d304518

Please sign in to comment.