webockets routes
This commit is contained in:
parent
72d2f3854f
commit
d8dc365b03
|
|
@ -121,10 +121,10 @@ $(document).ready(function(){
|
|||
ws_string = 'ws://'
|
||||
}
|
||||
if(typeof chatwebsocket != "undefined"){
|
||||
chatwebsocket = new WebSocket(ws_string+window.location.host+"/chat/{{roomdata.creator.pk}}/{{roomdata.chatmember_single.pk}}/")
|
||||
chatwebsocket = new WebSocket(ws_string+window.location.host+"/ws/chat/{{roomdata.creator.pk}}/{{roomdata.chatmember_single.pk}}/")
|
||||
}
|
||||
else{
|
||||
chatwebsocket = new WebSocket(ws_string+window.location.host+"/chat/{{roomdata.creator.pk}}/{{roomdata.chatmember_single.pk}}/")
|
||||
chatwebsocket = new WebSocket(ws_string+window.location.host+"/ws/chat/{{roomdata.creator.pk}}/{{roomdata.chatmember_single.pk}}/")
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -60,7 +60,7 @@ X_FRAME_OPTIONS = 'SAMEORIGIN'
|
|||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
SECRET_KEY = '_qv2t2lmsctjxpbb4rrp=op%_20_hxzonv^mvty1o85c)l$s^q'
|
||||
|
||||
ALLOWED_HOSTS = ['digitale-agentur.com', 'www.digitale-agentur.com', '127.0.0.1', 'dev01.digitale-agentur.com', '10.0.2.2']
|
||||
ALLOWED_HOSTS = ['digitale-agentur.com', 'www.digitale-agentur.com', '127.0.0.1', 'localhost', 'dev01.digitale-agentur.com', '10.0.2.2']
|
||||
|
||||
# Application definition
|
||||
INSTALLED_APPS = [
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@ from django.urls import re_path
|
|||
from . import mainwebsocket
|
||||
|
||||
websocket_urlpatterns = [
|
||||
re_path(r'chat/(?P<creator>\w+)/(?P<single>\w+)/$', mainwebsocket.UsersChat),
|
||||
re_path('main/', mainwebsocket.UsersConsumer),
|
||||
re_path(r'ws/chat/(?P<creator>\w+)/(?P<single>\w+)/$', mainwebsocket.UsersChat),
|
||||
re_path('ws/', mainwebsocket.UsersConsumer),
|
||||
]
|
||||
|
|
@ -659,7 +659,7 @@ $(document).ready(function(){
|
|||
ws_string = 'ws://'
|
||||
}
|
||||
|
||||
const mainwebsocket = new WebSocket(ws_string+window.location.host+"/main/")
|
||||
const mainwebsocket = new WebSocket(ws_string+window.location.host+"/ws/")
|
||||
|
||||
mainwebsocket.onmessage = function(e) {
|
||||
if(e["data"] != "presence_update")
|
||||
|
|
|
|||
Loading…
Reference in New Issue