Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

是否有计划让HttpController可以读取外部的目录或者增加允许跨域的配置? #29

Open
fantasy0v0 opened this issue Aug 19, 2024 · 0 comments

Comments

@fantasy0v0
Copy link

server.get("$htmlBase/*") { ctx ->
val path: String = ctx.req.uri().substring(htmlBase.length)
val b = classpathResourceHolder.get(path)
if (b == null) {
ctx.conn.response(404).send("Page Not Found\r\n")
} else {
ctx.conn.response(200).header("Content-Type", "text/html").send(b)
}
}

如果可以的话,就可以在里面放一些页面,通过http接口去管理vproxy,并且没有跨域的问题。

或许也可以让HttpController可以设置跨域配置,管理页面则交给其他服务去处理(可以管理多个vproxy)。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant