how do I fix ngrok invalid HTTP response error

Viewed 18292

I am using zphisher. when i create a link to ngrok, the link is generated, but on opening it it says ngrok gateway error The server returned an invalid or incomplete HTTP response. I got to know from ngrok error documentation that it is error 3004. they tell the error code and message but no possible way to fix the error. can someone help me please. I think my brother watches YouTube during his online classes and I want to conform it. No phishing. Please. I got absolutely no help from anywhere. Just one of my friend told me that i need an ngrok account for that. tried it, doesn't work.

4 Answers

After some time I got it fixed doing 2 things:

  1. Make sure my local site is http (not https)
  2. Running command ngrok http -host-header=rewrite localhost:PORT

For me, this command worked when I was receiving the 3004 error message and trying to access HTTPS on https://localhost:3000:

./ngrok http https://localhost:3000

I found an answer in this link and it solved my problem.

According to this you can use this command instead:

ngrok http https://localhost:[port]

If your site using https://localhost:port below really works for me

ngrok http https://localhost:port --host-header=rewrite
Related