如何从HttpContext获取Dev Tunnel URL?我通常会得到这样的主机地址:
var host = HttpContext.Request.Host;
但是当我使用Dev Tunnel时,我希望得到他们提供的那个时髦的URL,但我仍然得到localhost。请帮帮忙
yyhrrdl81#
假设您在Visual Studio中使用开发隧道,您可以使用环境变量VS_TUNNEL_URL。更多信息请访问https://learn.microsoft.com/en-us/aspnet/core/test/dev-tunnels?view=aspnetcore-7.0#tunnel-url-environment-variables
VS_TUNNEL_URL
1条答案
按热度按时间yyhrrdl81#
假设您在Visual Studio中使用开发隧道,您可以使用环境变量
VS_TUNNEL_URL
。更多信息请访问https://learn.microsoft.com/en-us/aspnet/core/test/dev-tunnels?view=aspnetcore-7.0#tunnel-url-environment-variables