diff --git a/app/assets/javascripts/app/lib/app_post/websocket.coffee b/app/assets/javascripts/app/lib/app_post/websocket.coffee index 6664a52f1..b421e2388 100644 --- a/app/assets/javascripts/app/lib/app_post/websocket.coffee +++ b/app/assets/javascripts/app/lib/app_post/websocket.coffee @@ -199,10 +199,13 @@ class _webSocketSingleton extends App.Controller protocol = 'wss://' if @backend is 'websocket' - @ws = new window.WebSocket( protocol + window.location.hostname + '/ws' ) + port = '' + if window.location.port && window.location.port != '' + port = ":#{window.location.port}" + @ws = new window.WebSocket("#{protocol}#{window.location.hostname}#{port}/ws") else if @backend is 'websocketPort' @backend_port = App.Config.get('websocket_port') || '6042' - @ws = new window.WebSocket( protocol + window.location.hostname + ':' + @backend_port + '/' ) + @ws = new window.WebSocket("#{protocol}#{window.location.hostname}:#{@backend_port}/") else @_ajaxInit()