Ngrok is a tool that creates a secure tunnel from the public internet to a port on your local machine. You can use it to expose a local web server to the internet, capture all traffic for detailed inspection and replay and share your work with others.
Here’s how you can use ngrok on Windows:
- Download ngrok: Go to https://ngrok.com/download and download the ngrok zip file for Windows.
- Unzip ngrok: Unzip the downloaded file to get the ngrok executable.
- Connect your account: Open a command prompt, navigate to the directory where you unzipped ngrok, and run the following command (replace
your_auth_token
with the auth token from your ngrok account):
ngrok authtoken your_auth_token
Start a tunnel: Run the following command to start a tunnel forwarding to your local application (replace your_port
with the port your application is running on):
ngrok http your_port
After running this command, you’ll see an ngrok terminal window showing the public URL of your tunnel and other information. Your local web server is now publicly accessible from the internet via the ngrok-provided URL.
Remember to keep your ngrok auth token secret and safe, as anyone with your auth token can open a tunnel to your local services.