Search code examples
vue.jsngrok

Solve the problem during publish localhost with ngrok


I am going to launch my local Vue application with ngrok.
I used this command.

ngrok http 8080

It says online.

enter image description here

But when I visit this site, it shows error.
enter image description here

This is the output from the ngrok. enter image description here

I think the problem is HTTPS. My local version is HTTPS. Here is the screenshot. enter image description here
How can I solve this problem?


Solution

  • ngrok assumes that the server it is forwarding to is listening for unencrypted HTTP traffic, but if your server is listening for encrypted HTTPS traffic you can specify a URL with an https:// scheme to request that ngrok speak HTTPS to your local server.

    Forward to an https server by specifying the https:// scheme

    ngrok http https://localhost:8080
    

    As a special case, ngrok assumes that if you forward to port 443 on any host that it should send HTTPS traffic and will act as if you specified an https:// URL.

    Forward to the default https port on localhost

    ngrok http 443
    

    ngrok assumes that your local network is private and it does not do any validation of the TLS certificate presented by your local server.

    If need be, explicitly direct to https locally.

    ngrok http https://localhost:8080 -host-header="localhost:8080"