简体   繁体   中英

Ngrok: Invalid/incomplete http response

I'm attemtping to use nGrok to make a .net twillio demo app accessable on my localhost. I'm currently getting the error ngrok gateway error The server returned an invalid or incomplete HTTP response. I've tried implementing solutions from here but without luck. My local app is using ssl and I'm running ngrok with the following command: ngrok http https://localhost:9932 --host-header="https://localhost:9932" .

I've also made an firewall exception for the ngrok package in Chocolatey`s (package manager) app data directory.

When I create a new ASP.NET Core website and use ngrok to tunnel using ngrok http https://localhost:9932 --host-header="https://localhost:9932" , I get an HTTP 400 Bad Request response. I couldn't get the same error as you shared.

Either way, this may fix it. In the --host-header argument, you should not include the https:// , just the localhost:9932 .

Once I used ngrok http https://localhost:9932 --host-header="localhost:9932" , it started working fine for me. Even ngrok http https://localhost:9932 without the --host-header works fine for me.

I know --host-header used to be necessary for ASP.NET on .NET Framework with IIS Express, but for ASP.NET Core using Kestrel, it's not necessary. I'm not sure if it's necessary for ASP.NET Core on IIS Express.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM