How to use Ngrok correctly with Angular-cli?

Asked

Viewed 321 times

0

Is there any right way to use Ngrok with Angular?

I’m trying to tunnel to my application that runs on localhost, creating a random web (URL) to make available on the internet, so I can perform the Webhook tests of the Moip Subscription API.

It turns out that when you enter the random URL created in the address bar of the Google Chrome browser and run, it loads the title of my application but does not render the content of my application on the page.

The Browser keeps trying to load, it is as if it was in an infinite loop, I looked in the console to check if there was an error, there is no error returned and through the address: localhost:4200 runs normally.

Command Prompt:

ng serve

ngrok http 4200 -host-header="localhost:4200"
  • in the network bar of develper-tools it is possible to see if the files are being loaded and the address that is being called, by the way, for what it serves the parameter -host-header because I have never used right with me using only ngrok http 4200

  • @Felipeduarte in the network bar is loading the scripts very slowly and can not render the page, I’m trying even in a new Angular project that there is almost nothing to load, but it takes a long time and does not load... the host-header parameter is due to the error that occurs: Invalid Host Header.

  • Have you tried changing doors? for me has always worked out to 80, 8000, 3412... can be both a simple internal problem in the application, as problems related to your machine, as your firewall settings, permissions etc... this all has in the https documentation://ngrok.com/Docs if you think the error is in the program itself, you can simply open an Issue in git of them https://github.com/inconshreveable/ngrok

  • I’ve been looking before their documentation, but I couldn’t find anything that could help me... through what you told me I saw that you are loading the files very slowly, it’s like a dialed connection... I need to perform tests with webhook but so far nothing...

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.