Monitoring local environments with ngrok
Checkly allows you to check your publicly accessible websites and APIs. However, by default Checkly won’t have access to sites that aren’t publicly available (for instance localhost).
With ngrok you can secure a tunnel to your localhost, so you can run checks on your internal sites directly, without the need to deploy every change.
Go to ngrok’s site and create an account.
Download Ngrok, install it and get it started.
Say you want to run checks on http://localhost:3000, you’ll need expose port 3000, with the command
./ngrok http 3000, or
ngrok http 3000if you extracted ngrok on your system’s $PATH.
You’ll get a screen similar to this.
Then you can use the “forwarding” URL in Checkly.
The check will successfully reach your localhost and ngrok will show successful HTTP requests.
Ngrok UI feature to inspect requests
If you navigate to the Web Interface URL returned in the terminal by ngrok (in the case shown above
http://127.0.0.1:4040/), you will be able to inspect requests.
The free version of ngrok allows to proxy connections only for one hour, then you need to manually restart ngrok, the proxy address will change and you will have to manually update the Checkly check with the new address.
Such limitation doesn’t exist with the paid version.