【问题标题】:ngrok and https tunnel for asp.net core application用于 asp.net 核心应用程序的 ngrok 和 https 隧道
【发布时间】:2019-07-14 23:30:19
【问题描述】:

当从 Visual Studio 启动时,ASP.NET CORE 应用程序的地址为 https://localhost:44313/。 要测试性能,您需要制作隧道。我使用 ngrok 和命令:

ngrok http -host-header=localhost 44313

但这不适用于 https。

谁能分享一个工作示例?

【问题讨论】:

    标签: asp.net-core https ngrok


    【解决方案1】:
    1. 下载当前版本的 ngrok
    2. 注册并获取令牌:https://dashboard.ngrok.com/auth
    3. 运行 ngrok 并使用以下命令设置令牌:ngrok authtoken YOUR_AUTHTOKEN
    4. 创建隧道: ngrok http -host-header=localhost https://localhost:44313

    2019 年 4 月 11 日更新

    【讨论】:

    • 我仍然无法通过 https,您是否有机会进行其他更改?
    • @thalacker 如上所述。但我使用的是最新的当前版本。
    • @thalacker 忘记说明了,一定要使用授权时获得的token(dashboard.ngrok.com/auth)
    【解决方案2】:

    使用 ngrok 2.3.29 版本并添加了 authtoken(不确定 authtoken 是否会影响结果,我只是按照在线安装指南添加的)。

    这个命令对我有用:

    ngrok http https://localhost:{your-app-port} -host-header=localhost:{your-app-port}
    

    与现有答案的区别:我将 localhost:port 传递给 -host-header

    与您的问题不同:我使用 ngrok http https://localhos:port 而不是 ngrok http http://localhos:port(https 而不是 http)

    【讨论】:

      猜你喜欢
      • 2019-03-27
      • 2021-04-16
      • 2022-07-14
      • 2017-06-17
      • 1970-01-01
      • 2019-12-04
      • 1970-01-01
      • 1970-01-01
      • 2018-05-14
      相关资源
      最近更新 更多