mirror of
https://github.com/django/daphne.git
synced 2025-07-10 16:02:18 +03:00
parent
2f3114b21e
commit
e0341e65cd
|
@ -134,7 +134,7 @@ need to change the socket address if you're using a development VM or similar)::
|
||||||
|
|
||||||
// Note that the path doesn't matter for routing; any WebSocket
|
// Note that the path doesn't matter for routing; any WebSocket
|
||||||
// connection gets bumped over to WebSocket consumers
|
// connection gets bumped over to WebSocket consumers
|
||||||
socket = new WebSocket("ws://127.0.0.1:8000/chat/");
|
socket = new WebSocket("ws://" + window.location.host + "/chat/");
|
||||||
socket.onmessage = function(e) {
|
socket.onmessage = function(e) {
|
||||||
alert(e.data);
|
alert(e.data);
|
||||||
}
|
}
|
||||||
|
@ -228,7 +228,7 @@ code in the developer console as before::
|
||||||
|
|
||||||
// Note that the path doesn't matter right now; any WebSocket
|
// Note that the path doesn't matter right now; any WebSocket
|
||||||
// connection gets bumped over to WebSocket consumers
|
// connection gets bumped over to WebSocket consumers
|
||||||
socket = new WebSocket("ws://127.0.0.1:8000/chat/");
|
socket = new WebSocket("ws://" + window.location.host + "/chat/");
|
||||||
socket.onmessage = function(e) {
|
socket.onmessage = function(e) {
|
||||||
alert(e.data);
|
alert(e.data);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user