Skip to content

Commit

Permalink
Allow disabling autoConnect
Browse files Browse the repository at this point in the history
  • Loading branch information
jondubois committed Mar 9, 2017
1 parent 8f0da72 commit 351d991
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ var socket = socketCluster.connect(options);

(The MIT License)

Copyright (c) 2013-2016 SocketCluster.io
Copyright (c) 2013-2017 SocketCluster.io

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
4 changes: 3 additions & 1 deletion lib/scsocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ var SCSocket = function (opts) {
this.options.query = querystring.parse(this.options.query);
}

this.connect();
if (this.options.autoConnect) {
this.connect();
}

this._channelEmitter = new SCEmitter();

Expand Down
1 change: 1 addition & 0 deletions lib/scsocketcreator.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ function connect(options) {
hostname: global.location && location.hostname,
path: '/socketcluster/',
secure: isSecureDefault,
autoConnect: true,
autoReconnect: true,
autoProcessSubscriptions: true,
connectTimeout: 20000,
Expand Down

0 comments on commit 351d991

Please sign in to comment.