我正在尝试开发一个web应用程序,为了oauth2调试,我需要web应用程序响应https,这是如何用Yew开发的?
目前我正在使用:
trunk serve --proxy-backend=<backend-endpoint>为了服务。
发布于 2022-11-16 19:29:24
您可以通过HTTP隧道使用隧道,该隧道将开发服务器打开到internet,并具有https。我可以推荐您使用Ngrok,但是还有更多的服务。例:
ngrok http 8080您可以将它与类似于cargo-make的内容组合起来,以添加一个新命令。
use ngrok;
fn main() -> std::io::Result<()> {
let tunnel = ngrok::builder()
.http()
.port(8080)
.run()?;
let public_url: url::Url = tunnel.http()?;
Command::new("trunk")
.arg("serve")
.arg(format!("--proxy-backend={public_url}"))
.output()
.expect("failed to execute process")
Ok(())
} https://stackoverflow.com/questions/74425821
复制相似问题