We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1b6c191 commit f037bebCopy full SHA for f037beb
client-src/clients/WebsocketClient.js
@@ -8,14 +8,7 @@ const BaseClient = require('./BaseClient');
8
module.exports = class WebsocketClient extends BaseClient {
9
constructor(url) {
10
super();
11
- this.client = new WebSocket(
12
- ((urlToChange) => {
13
- let wsUrl = urlToChange;
14
- wsUrl = wsUrl.replace(/^http/, 'ws');
15
- wsUrl = wsUrl.replace(/^file/, 'ws');
16
- return wsUrl;
17
- })(url)
18
- );
+ this.client = new WebSocket(url.replace(/^(?:http|file)/, 'ws'));
19
20
this.client.onerror = (err) => {
21
log.error(err);
0 commit comments