Skip to content

Instantly share code, notes, and snippets.

@xola139
Created February 19, 2018 19:17
Show Gist options
  • Save xola139/906cff7d4c2460e6de1dd6998386a0d8 to your computer and use it in GitHub Desktop.
Save xola139/906cff7d4c2460e6de1dd6998386a0d8 to your computer and use it in GitHub Desktop.
When Invalid Host Header when ngrok tries to connect to Angular or React dev server
When Invalid Host Header when ngrok tries to connect to Angular or React dev server use this form for run ngrok.
ngrok http 8080 -host-header="localhost:8080"
ngrok http --host-header=rewrite 8080
@blackbomb404
Copy link

blackbomb404 commented Oct 31, 2022

All i do is (on Angular side) ng serve --disable-host-check

Is it a bad approach?

@tuliren
Copy link

tuliren commented Nov 17, 2022

Does anyone know how to get this working with a custom URL?

@liquidvisual, it's probably irrelevant now. But I got ngrok working for a custom URL with the following config:

authtoken: <token>
version: 2
region: us
tunnels:
  <tunnel-name>:
    addr: https://mydomain.com
    host_header: mydomain.com
    proto: http
    hostname: <ngrok-host>

@OleksiiB5021
Copy link

It crashes ngrok on my end

@electr0sheep
Copy link

Thanks for this, it fixed my issue.

There was a question about how to do this with a custom URL.
ngrok http --subdomain {{subdomain}} --host-header=rewrite {{port}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment