prepareConnection

suspend fun prepareConnection(url: String, token: String? = null)

prepareConnection should be called as soon as the page is loaded, in order to speed up the connection attempt. This function will

  • perform DNS resolution and pre-warm the DNS cache

  • establish TLS connection and cache TLS keys

With LiveKit Cloud, it will also determine the best edge data center for the current client to connect to if a token is provided.