ngrok and https tunnel for asp.net core application

有些话、适合烂在心里 提交于 2020-01-23 08:21:18

问题


The ASP.NET CORE application, when launched from visual studio, has the address https://localhost:44313/. To test the performance you need to make a tunnel. I use ngrok and the command:

ngrok http -host-header=localhost 44313

But this does not work for https.

Can anyone share a working example?


回答1:


  1. Download the current version of ngrok
  2. Register and get a token: https://dashboard.ngrok.com/auth
  3. Run ngrok and set the token with the command: ngrok authtoken YOUR_AUTHTOKEN
  4. Create a tunnel: ngrok http -host-header=localhost https://localhost:44313

Update 11 april 2019




回答2:


Using ngrok version 2.3.29 and added authtoken (not sure if authtoken influences outcome, I've just added it following the online installation guide).

This command worked for me:

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

Difference from existing answer: I pass localhost:port to -host-header

Difference form your question: I use ngrok http https://localhos:port instead of ngrok http http://localhos:port (https instead of http)



来源:https://stackoverflow.com/questions/54800512/ngrok-and-https-tunnel-for-asp-net-core-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!