9

When I start an HTTP tunnel, ngrok automatically starts forwarding on both HTTP and HTTPS. Is there a way to only start one of them?

gouyez
  • 93
  • 1
  • 2
  • 7

3 Answers3

9

Currently, to force the scheme (http instead of https) it is:

ngrok --scheme http http 8080

^ Binds to the 8080 port of the localhost

xyz
  • 524
  • 10
  • 22
1

You'll need to set the bind-tls option in your ngrok config. --bind-tls "true"

Docs here: https://ngrok.com/docs#http-bind-tls

Peter DeWeese
  • 18,141
  • 8
  • 79
  • 101
user2738058
  • 317
  • 1
  • 5
1

Tunneling to HTTP or HTTPS only

By default, when ngrok runs an HTTP tunnel, it opens endpoints for both HTTP and HTTPS traffic. If you wish to only forward HTTP or HTTPS traffic, but not both, you can toggle this behavior with the --scheme flag.

Example: Only listen on an HTTP tunnel endpoint

ngrok http --scheme=http site.dev:80

Example: Only listen on an HTTPS tunnel endpoint

ngrok http --scheme=https site.dev:80
CodingEra
  • 1,313
  • 10
  • 20