mirror of
https://github.com/ansible/awx.git
synced 2026-03-18 09:27:31 -02:30
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:
@@ -27,6 +27,7 @@ class AWXProtocolTypeRouter(ProtocolTypeRouter):
|
|||||||
|
|
||||||
|
|
||||||
websocket_urlpatterns = [
|
websocket_urlpatterns = [
|
||||||
|
re_path(r'api/websocket/$', consumers.EventConsumer.as_asgi()),
|
||||||
re_path(r'websocket/$', consumers.EventConsumer.as_asgi()),
|
re_path(r'websocket/$', consumers.EventConsumer.as_asgi()),
|
||||||
re_path(r'websocket/relay/$', consumers.RelayConsumer.as_asgi()),
|
re_path(r'websocket/relay/$', consumers.RelayConsumer.as_asgi()),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ location {{ (ingress_path + '/favicon.ico').replace('//', '/') }} {
|
|||||||
alias /awx_devel/awx/public/static/favicon.ico;
|
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
|
# Pass request to the upstream alias
|
||||||
proxy_pass http://daphne;
|
proxy_pass http://daphne;
|
||||||
# Require http version 1.1 to allow for upgrade requests
|
# Require http version 1.1 to allow for upgrade requests
|
||||||
|
|||||||
Reference in New Issue
Block a user