Skip to content

Commit 449c1db

Browse files
committed
v0.9.50 - Can now change default socketcluster ws path
1 parent 09c937a commit 449c1db

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ SocketCluster.prototype._init = function (options) {
7575
rebootOnSignal: true,
7676
useSmartBalancing: false,
7777
downgradeToUser: false,
78+
path: null,
7879
clusterEngine: 'iocluster'
7980
};
8081

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "socketcluster",
33
"description": "SocketCluster - A Highly parallelized WebSocket server cluster to make the most of multi-core machines/instances.",
4-
"version": "0.9.49",
4+
"version": "0.9.50",
55
"homepage": "https://github.com/topcloud/socketcluster",
66
"contributors": [
77
{
@@ -17,7 +17,7 @@
1717
"iocluster": ">= 1.3.1",
1818
"loadbalancer": ">= 0.9.19",
1919
"optimist": "0.6.1",
20-
"socketcluster-server": ">= 0.9.31",
20+
"socketcluster-server": ">= 0.9.32",
2121
"wrench": "1.5.8"
2222
},
2323
"bin": {

scworker.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ SCWorker.prototype._init = function (options) {
100100
secure: this.options.protocol == 'https',
101101
host: this.options.host,
102102
origins: this.options.origins,
103-
appName: this.options.appName
103+
appName: this.options.appName,
104+
path: this.options.path
104105
});
105106

106107
this._socketServer.on('connection', function (socket) {
@@ -114,8 +115,8 @@ SCWorker.prototype._init = function (options) {
114115
self.noticeHandler.apply(self, arguments);
115116
});
116117

117-
this._socketURL = this._socketServer.getURL();
118-
this._socketURLRegex = new RegExp('^' + this._socketURL);
118+
this._socketPath = this._socketServer.getPath();
119+
this._socketPathRegex = new RegExp('^' + this._socketPath);
119120

120121
this._errorDomain.add(this._socketServer);
121122
this._socketServer.on('ready', function () {
@@ -125,7 +126,7 @@ SCWorker.prototype._init = function (options) {
125126
};
126127

127128
SCWorker.prototype.getSocketURL = function () {
128-
return this._socketURL;
129+
return this._socketPath;
129130
};
130131

131132
SCWorker.prototype._start = function () {
@@ -153,7 +154,7 @@ SCWorker.prototype._httpRequestHandler = function (req, res) {
153154
this._httpRequestCount++;
154155
if (req.url == this._paths.statusURL) {
155156
this._handleStatusRequest(req, res);
156-
} else if (!this._socketURLRegex.test(req.url)) {
157+
} else if (!this._socketPathRegex.test(req.url)) {
157158
this._server.emit('req', req, res);
158159
}
159160
};

0 commit comments

Comments
 (0)