Certain events may require clients to reconnect to an HTTP stream. It is essential that clients obey re-connection timing restrictions:

  • Initial reconnects can be performed immediately.
  • Network errors or time-outs should cause a client to back off linearly. For example, increase from 1 to 16 seconds in steps of 1 second.
  • Non HTTP-200 codes should cause a client to back off exponentially. For example, start at a 10 second delay and double to a maximum of 320 seconds.

Clients who repeatedly ignore these timing guidelines may face a temporary ban.

For more resources on connecting to HTTP streams, we recommend that you consult the Twitter documentation on connecting to streams as ours works in a very similar way.