disable http auth for websockets
This commit is contained in:
parent
c88d434f39
commit
79c31d6d22
3 changed files with 10 additions and 2 deletions
|
@ -3,6 +3,6 @@ from django.urls import path
|
|||
from .consumers import NotifyConsumer
|
||||
|
||||
websocket_urlpatterns = [
|
||||
path('notify/<str:event_slug>/', NotifyConsumer.as_asgi()),
|
||||
path('ws/notify/<str:event_slug>/', NotifyConsumer.as_asgi()),
|
||||
]
|
||||
|
||||
|
|
|
@ -24,6 +24,14 @@ server {
|
|||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
location /ws {
|
||||
proxy_http_version 1.1;
|
||||
auth_basic off;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_pass http://c3lf-sys3;
|
||||
}
|
||||
|
||||
location /api {
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
|
|
@ -35,7 +35,7 @@ export default {
|
|||
}
|
||||
},
|
||||
created: function () {
|
||||
this.notify_socket = new WebSocket('wss://' + window.location.host + '/notify/');
|
||||
this.notify_socket = new WebSocket('wss://' + window.location.host + '/ws/notify/');
|
||||
this.notify_socket.onmessage = (e) => {
|
||||
let data = JSON.parse(e.data);
|
||||
console.log(data, e.data);
|
||||
|
|
Loading…
Reference in a new issue