Improved logging.
This commit is contained in:
parent
bb2bce6763
commit
17d499cbe3
1 changed files with 8 additions and 5 deletions
|
@ -43,6 +43,7 @@ class _webSocketSingleton extends App.Controller
|
|||
connectionWasEstablished: false
|
||||
tryToConnect: false
|
||||
backend: 'websocket'
|
||||
backend_port: ''
|
||||
client_id: undefined
|
||||
error: false
|
||||
|
||||
|
@ -185,14 +186,16 @@ class _webSocketSingleton extends App.Controller
|
|||
if @backend is 'websocket'
|
||||
@ws = new window.WebSocket( protocol + window.location.hostname + '/ws' )
|
||||
else if @backend is 'websocketPort'
|
||||
websocket_port = App.Config.get('websocket_port') || '6042'
|
||||
@ws = new window.WebSocket( protocol + window.location.hostname + ':' + websocket_port + '/' )
|
||||
@backend_port = App.Config.get('websocket_port') || '6042'
|
||||
@ws = new window.WebSocket( protocol + window.location.hostname + ':' + @backend_port + '/' )
|
||||
else
|
||||
@_ajaxInit()
|
||||
|
||||
# Set event handlers.
|
||||
@ws.onopen = =>
|
||||
@log 'notice', "new websocket (#{@channel()}) connection open"
|
||||
if @backend_port
|
||||
port = ":#{@backend_port}"
|
||||
@log 'notice', "new websocket (#{@channel()}#{port}) connection open"
|
||||
|
||||
@connectionEstablished = true
|
||||
@connectionWasEstablished = true
|
||||
|
|
Loading…
Reference in a new issue