       error: =>
         @_ajaxInitDone = true
         @_ajaxInitWorking = false
+
+        # try reconnect on error after x sec.
+        reconnect = =>
+          @_ajaxInit( force: true )
+        @delay reconnect, 10000, '_ajaxInit-reconnect-on-error', 'ws'
     )
 
   _ajaxSend: (data) =>

      @queue = []

      # send ping to check connection
      @delay @ping, 60000, undefined, 'ws'

    @ws.onmessage = (e) =>
      pipe = JSON.parse( e.data )

    @log 'Websocket', 'debug', 'received websockend ping'

    # test again after 1 min
    @delay @ping, 60000, 'websocket-pong', 'ws'

  connect: =>
    return if @backend is 'ajax'
