Skip to content

Commit

Permalink
Use websocket-secured when ui is loaded with https
Browse files Browse the repository at this point in the history
  • Loading branch information
psi-4ward committed Oct 15, 2020
1 parent dccbc3d commit 2df5b91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/src/Service.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default class Service {
return new Promise((resolve, reject) => {
// TODO: reconnect
let resolved = false;
this.ws = new WebSocket(`ws://${ document.location.host }/ws`);
this.ws = new WebSocket(`${document.location.protocol === 'https:' ? 'wss' : 'ws'}://${ document.location.host }/ws`);

this.ws.onopen = () => {
this.data.beErrors = [];
Expand Down

0 comments on commit 2df5b91

Please sign in to comment.