diff --git a/README.md b/README.md index 6f7aa80..48b47ae 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/lib/scsocket.js b/lib/scsocket.js index e543834..1703b2d 100644 --- a/lib/scsocket.js +++ b/lib/scsocket.js @@ -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(); diff --git a/lib/scsocketcreator.js b/lib/scsocketcreator.js index 40bc626..75c6628 100644 --- a/lib/scsocketcreator.js +++ b/lib/scsocketcreator.js @@ -59,6 +59,7 @@ function connect(options) { hostname: global.location && location.hostname, path: '/socketcluster/', secure: isSecureDefault, + autoConnect: true, autoReconnect: true, autoProcessSubscriptions: true, connectTimeout: 20000,