Kweb

class Kweb : Closeable

Constructors

Kweb
Link copied to clipboard
fun Kweb(port: Int, debug: Boolean = true, plugins: List<KwebPlugin> = Collections.emptyList(), httpsConfig: EngineSSLConnectorConfig? = null, kwebConfig: KwebConfiguration = KwebDefaultConfiguration(), buildPage: WebBrowser.() -> Unit)
The core kwebserver, and the starting point for almost any Kweb app.

Types

Feature
Link copied to clipboard
object Feature : ApplicationFeature<Application, Kweb.Feature.Configuration, Kweb>
If you have an existing Ktor server, you can use the Kweb class as a feature.

Functions

addCallback
Link copied to clipboard
fun addCallback(sessionId: String, callbackId: Int, callback: (JsonElement) -> Unit)
callJs
Link copied to clipboard
fun callJs(sessionId: String, funcCall: FunctionCall, debugInfo: DebugInfo? = null)
close
Link copied to clipboard
open override fun close()
refreshAllPages
Link copied to clipboard
fun refreshAllPages(): Job
Forces all currently connected clients to refresh their pages.
removeCallback
Link copied to clipboard
fun removeCallback(clientId: String, callbackId: Int)
respondKweb
Link copied to clipboard
suspend fun respondKweb(call: ApplicationCall, buildPage: WebBrowser.() -> Unit)
sendMessage
Link copied to clipboard
fun sendMessage(sessionId: String, server2ClientMessage: Server2ClientMessage)

Properties

debug
Link copied to clipboard
val debug: Boolean
kwebConfig
Link copied to clipboard
val kwebConfig: KwebConfiguration
plugins
Link copied to clipboard
val plugins: List<KwebPlugin>