Allow connecting to websockets via api/websocket/

* Before, we just allowed websockets on <host>/websocket/. With this
  change, they can now come from <host>/api/websocket/
This commit is contained in:
Chris Meyers 2024-02-12 15:28:03 -05:00 committed by Dave
parent 4b637c1319
commit f429ef6ca7
2 changed files with 2 additions and 1 deletions

View File

@ -27,6 +27,7 @@ class AWXProtocolTypeRouter(ProtocolTypeRouter):
websocket_urlpatterns = [
re_path(r'api/websocket/$', consumers.EventConsumer.as_asgi()),
re_path(r'websocket/$', consumers.EventConsumer.as_asgi()),
re_path(r'websocket/relay/$', consumers.RelayConsumer.as_asgi()),
]

View File

@ -10,7 +10,7 @@ location {{ (ingress_path + '/favicon.ico').replace('//', '/') }} {
alias /awx_devel/awx/public/static/favicon.ico;
}
location {{ (ingress_path + '/websocket').replace('//', '/') }} {
location ~ ({{ (ingress_path + '/websocket').replace('//', '/') }}|{{ (ingress_path + '/api/websocket').replace('//', '/') }}) {
# Pass request to the upstream alias
proxy_pass http://daphne;
# Require http version 1.1 to allow for upgrade requests