startEmbedded

fun startEmbedded(port: Int = 8080, host: String = "127.0.0.1", uiPath: String? = null): RunningDevToolsServer(source)

Starts the DevTools server without blocking the calling thread.

Intended for embedding the server in a host process and for tests that need to drive real clients against it. Unlike start, this returns as soon as the engine is up.

Usage:

val server = DevToolsServer.startEmbedded(port = 0)
try {
// drive clients against server.port
} finally {
server.stop()
}

Return

A handle exposing the resolved RunningDevToolsServer.port and RunningDevToolsServer.stop

Parameters

port

Port to listen on, or 0 to let the OS choose a free one

host

Host address (default: 127.0.0.1)

uiPath

Path to the WASM UI distribution directory (optional)