在Ktor中将url的内容添加到responsdText中




我有一个url,我想使用Ktor框架将其显示为网页的内容。

fun Application.module() {
    install(DefaultHeaders)
    install(CallLogging)
    install(Routing) {
        get("/") {
            call.respondText(/*Content of that url in the output ?*/, ContentType.Text.Any)
        }
    }
}

提前谢谢。

这看起来像是一种代理。您可以在此处查看反向代理示例:https://github.com/ktorio/ktor-samples/tree/master/other/reverse-proxy

最新更新