Fixed websocket
This commit is contained in:
parent
72af7adb46
commit
6ff1552063
2 changed files with 2 additions and 2 deletions
|
@ -124,7 +124,7 @@ class HttpBackend(Backend):
|
||||||
loop = asyncio.new_event_loop()
|
loop = asyncio.new_event_loop()
|
||||||
asyncio.set_event_loop(loop)
|
asyncio.set_event_loop(loop)
|
||||||
loop.run_until_complete(
|
loop.run_until_complete(
|
||||||
websockets.serve(register_websocket, 'localhost', self.websocket_port))
|
websockets.serve(register_websocket, '0.0.0.0', self.websocket_port))
|
||||||
loop.run_forever()
|
loop.run_forever()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ $(document).ready(function() {
|
||||||
var eventListeners = [];
|
var eventListeners = [];
|
||||||
|
|
||||||
var initWebsocket = function() {
|
var initWebsocket = function() {
|
||||||
websocket = new WebSocket('ws://localhost:' + window.websocket_port);
|
websocket = new WebSocket('ws://' + window.location.hostname + ':' + window.websocket_port);
|
||||||
websocket.onmessage = function(event) {
|
websocket.onmessage = function(event) {
|
||||||
for (var listener of eventListeners) {
|
for (var listener of eventListeners) {
|
||||||
data = event.data;
|
data = event.data;
|
||||||
|
|
Loading…
Reference in a new issue