Skip to content

Instantly share code, notes, and snippets.

@andre-vidal
Last active January 20, 2024 01:27
Show Gist options
  • Save andre-vidal/9d18c2b2285fac9afe963900b953e9dc to your computer and use it in GitHub Desktop.
Save andre-vidal/9d18c2b2285fac9afe963900b953e9dc to your computer and use it in GitHub Desktop.
How to configure a simple http ngrok tunnel
# Default Location: C:/Users/<username>/AppData/Local/ngrok
version: "2" # Specifies the version of the config file to use.
authtoken: <your-auth-token-here> # Configured in your ngrok dashboard
region: us # Choose the region where the ngrok agent will connect to host its tunnels.
tunnels:
tunnelname:
proto: http # Protocol name
schemes:
- https # Bind to a specific scheme (http or https)
addr: https://localhost:3000 # Forward traffic to this local port number or network address.
hostname: custom-name.ngrok.io # Any valid hostname that you have previously registered with ngrok (or is available on the domain)
host_header: localhost:3000 # Required to prevent 3004 Invalid host header error
# For More: https://ngrok.com/docs/ngrok-agent/config
@andre-vidal
Copy link
Author

Please note that to use a custom hostname you have to have the appropriate ngrok plan. This feature is not available on the free tier.

@grave-tender
Copy link

can confirm it worked for me, thank you so much. I didn't figure out I needed to input the full address in the addr field

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