Fixed websocket

This commit is contained in:
Fabio Manganiello 2018-01-29 14:46:31 +01:00
parent 72af7adb46
commit 6ff1552063
2 changed files with 2 additions and 2 deletions

View file

@ -124,7 +124,7 @@ class HttpBackend(Backend):
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
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()

View file

@ -3,7 +3,7 @@ $(document).ready(function() {
var eventListeners = [];
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) {
for (var listener of eventListeners) {
data = event.data;