Make JS client connections restartable after timing out and disconnecting