Skip to content

Commit

Permalink
Use secure web sockets on HTTPS
Browse files Browse the repository at this point in the history
  • Loading branch information
acdha committed Mar 20, 2019
1 parent ea9f2ee commit d16247f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion concordia/static/js/action-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ export class ActionApp {

connectAssetEventStream() {
let assetSocketURL = // FIXME: this path should not be hard-coded
'ws://' + window.location.host + '/ws/asset/asset_updates/';
(document.location.protocol == 'https:' ? 'wss://' : 'ws://') +
window.location.host +
'/ws/asset/asset_updates/';
console.log(`Connecting to ${assetSocketURL}`);
let assetSocket = (this.assetSocket = new WebSocket(assetSocketURL));

Expand Down

0 comments on commit d16247f

Please sign in to comment.