diff --git a/platypush/backend/http/__init__.py b/platypush/backend/http/__init__.py index 0d3fae6b..ea7d90cc 100644 --- a/platypush/backend/http/__init__.py +++ b/platypush/backend/http/__init__.py @@ -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() diff --git a/platypush/backend/http/static/js/application.js b/platypush/backend/http/static/js/application.js index 0ea6987d..307bfde6 100644 --- a/platypush/backend/http/static/js/application.js +++ b/platypush/backend/http/static/js/application.js @@ -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;