Commit 887387f8 authored by Robin Tissot's avatar Robin Tissot
Browse files

Fixes 'The operation is insecure.' on websocket messages.

parent ce8b4d66
......@@ -40,15 +40,16 @@ class Alert {
}
$(document).ready(function() {
msgSocket = new ReconnectingWebSocket('ws://' + window.location.host + '/ws/notif/');
let scheme = location.protocol === 'https:'?'wss:':'ws:';
msgSocket = new ReconnectingWebSocket(scheme + '//' + window.location.host + '/ws/notif/');
msgSocket.maxReconnectAttempts = 3;
msgSocket.addEventListener('open', function(e) {
if (DEBUG) {
console.log('Connected to notification socket');
}
});
msgSocket.addEventListener('message', function(e) {
var data = JSON.parse(e.data);
if (DEBUG) {
......@@ -63,7 +64,7 @@ $(document).ready(function() {
$container.trigger(data["name"], data["data"]);
}
});
msgSocket.addEventListener('close', function(e) {
if (DEBUG) {
console.error('Notification socket closed unexpectedly');
......
......@@ -90,6 +90,8 @@ services:
command: ["flower", "--broker=redis://redis:6379/0", "--port=5555"]
ports:
- 5555:5555
depends_on:
- redis
# No need while we don't have regular tasks
# celerybeat:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment