Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion client-src/clients/WebsocketClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ const BaseClient = require('./BaseClient');
module.exports = class WebsocketClient extends BaseClient {
constructor(url) {
super();
this.client = new WebSocket(url.replace(/^http/, 'ws'));
this.client = new WebSocket(
((urlToChange) => {
let wsUrl = urlToChange;
wsUrl = wsUrl.replace(/^http/, 'ws');
wsUrl = wsUrl.replace(/^file/, 'ws');
return wsUrl;
})(url)
);
Comment thread
kroko marked this conversation as resolved.
Outdated

this.client.onerror = (err) => {
log.error(err);
Expand Down