setRequestHandler

open fun setRequestHandler(requestHandler: (String) -> Any)

Sets a custom request handler. This will be triggered when the server calls `sendScriptRequest` with the request. The request handler should return an object that will be serialized to json. The json will then be sent to the server as a response.

Parameters

requestHandler

the requestHandler to handle server requests send via `sendScriptRequest`