serverUrl

Configure the server URL.

Parameters

serverUrl

the url to use to establish the WebSocket connection. It can start with 'https://' or 'wss://' (respectively 'http://' or 'ws://' for unsecure versions), both are handled the same way by the underlying code.


fun serverUrl(serverUrl: suspend () -> String?): WebSocketNetworkTransport.Builder

Configure the server URL.

Parameters

serverUrl

a function return the url to use to establish the WebSocket connection. The url can start with 'https://' or 'wss://' (respectively 'http://' or 'ws://' for unsecure versions), both are handled the same way by the underlying code.

serverUrl is called every time a WebSocket is opened. For example, you can use it to update your auth credentials in case of an unauthorized error.

It is a suspending function, so it can be used to introduce delay before setting the new serverUrl.