webSocketFactory
Returns a WebSocket.Factory that creates its sockets with delegate, usually your OkHttpClient, and records their messages and lifecycle events in the registered NetworkDebugTab. Create the sockets you want to inspect with it, or give it to a library that takes a WebSocket.Factory:
val sockets = lustro.webSocketFactory(okHttpClient)
val socket = sockets.newWebSocket(request, listener)Content copied to clipboard
networkInterceptor shows only a socket's handshake, because OkHttp sends nothing else through interceptors. A socket from this factory behaves as one from delegate: your listener gets the same calls, and send, close, and queueSize return what delegate's socket returns. Capture adds a constant cost to each message on the calling thread.
When no network tab is registered, or in a build that start refuses to arm, returns delegate.