Skip to content

Commit ad2d197

Browse files
authored
refactor: option names (#3363)
1 parent f5e7f8f commit ad2d197

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

lib/Server.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ class Server {
3535
this.sockets = [];
3636
this.staticWatchers = [];
3737
// Keep track of websocket proxies for external websocket upgrade.
38-
this.websocketProxies = [];
39-
// this value of ws can be overwritten for tests
40-
this.wsHeartbeatInterval = 30000;
38+
this.webSocketProxies = [];
39+
// this value of web socket can be overwritten for tests
40+
this.webSocketHeartbeatInterval = 30000;
4141

4242
normalizeOptions(this.compiler, this.options, this.logger);
4343

@@ -69,8 +69,8 @@ class Server {
6969
// Proxy WebSocket without the initial http request
7070
// https://github.com/chimurai/http-proxy-middleware#external-websocket-upgrade
7171
// eslint-disable-next-line func-names
72-
this.websocketProxies.forEach(function (wsProxy) {
73-
this.server.on('upgrade', wsProxy.upgrade);
72+
this.webSocketProxies.forEach(function (webSocketProxy) {
73+
this.server.on('upgrade', webSocketProxy.upgrade);
7474
}, this);
7575
}
7676

@@ -206,7 +206,7 @@ class Server {
206206
proxyMiddleware = getProxyMiddleware(proxyConfig);
207207

208208
if (proxyConfig.ws) {
209-
this.websocketProxies.push(proxyMiddleware);
209+
this.webSocketProxies.push(proxyMiddleware);
210210
}
211211

212212
const handle = async (req, res, next) => {

lib/servers/WebsocketServer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module.exports = class WebsocketServer extends BaseServer {
4040
socket.isAlive = false;
4141
socket.ping(noop);
4242
});
43-
}, this.server.wsHeartbeatInterval);
43+
}, this.server.webSocketHeartbeatInterval);
4444
}
4545

4646
send(connection, message) {

test/server/servers/WebsocketServer.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('WebsocketServer', () => {
2525
},
2626
},
2727
server,
28-
wsHeartbeatInterval: 800,
28+
webSocketHeartbeatInterval: 800,
2929
});
3030
done();
3131
});

0 commit comments

Comments
 (0)