Kuzzle: How does the autoReconnect argument works in WebSocket?

Viewed 12

i want kuzzle to reconnect on a disconnected event, so i set autoReconnect argument to true as written in my code:

const connectionOptions = {
    autoReconnect: true,
    // reconnectionDelay: 500,
    ssl: true,
    port: PORT
  }

  kuzzle = new Kuzzle(new WebSocket(ADDRESS, connectionOptions), {
    autoQueue: true,
    autoReplay: true,
    offlineMode: 'auto',
    queueTTL: 0,
    queueMaxSize: 500
  })

i check the event of kuzzle with this:

  kuzzle.on('reconnected', () => {
    console.log('kuzzle reconnected')
  })

  kuzzle.on('disconnected', () => {
    console.log('kuzzle disconnected')
  })

But the only thing i see is the disconnected event but never the reconnect. Why ????

PS: i disable and enable my network interfaces to test my code

0 Answers
Related