Handling Forwarding Request Using Ngrok

Ngrok is one of the most well-known tools for local tunneling solutions. I have used it many times since it's the easiest tool for any developer.
This time once again, I thought to use Ngrok for my current application, which uses Graph API to get notifications from Microsoft Teams channel. As always, I launched the ngrok with the required port as shown below,
  1. ngrok http 44332
and it got connected as shown below,
 
Handling Forwarding Request Using Ngrok
So far everything is alright. But now when I run my application with ngrok’s forwarding address, I end up getting error 400 Bad Request.
Handling Forwarding Request Using Ngrok
 
 And here is what I read about this. It seems like some applications can’t deal with the default behavior of ngrok and need an explicit mention of header information, which means there is another way to handle this scenario,
  1. ngrok http http://localhost:44332 -host-header="localhost:44332"  
After connecting ngrok with above command, everything went very smoothly and as expected.
 
Handling Forwarding Request Using Ngrok
 
I hope this article will be useful for you. Happy learning!