Getting Started with Agent Endpoints and Traffic Policy via Configuration File
The following getting started guide will take you through starting an Agent Endpoint with a applied via the Agent Configuration File. Note, this guide requires that your agent configuration file is set to v3.
What you'll need
- An ngrok account.
- The ngrok Agent CLI installed.
1. Edit your ngrok configuration file
Enter the following command into your terminal:
Loading…
In your configuration file, add the following content to the bottom and save the file:
Loading…
This policy will respond to each HTTP request with “Hello, World!"
Your configuration file version
must be set to 3
.
2. Start your Agent Endpoint
Start your Agent Endpoint by running the following command:
Loading…
This command will start an HTTP tunnel for port 80
, using the specified traffic policy in the config file to manage traffic.
3. Test it out
After running the ngrok command in the previous step you should now see a URL in the forwarding section. Open the URL in your web browser. You should see the "Hello, World!" message displayed in your browser.
What's next?
You've now successfully set up your first Agent Endpoint with a custom Traffic Policy using the ngrok agent configuration file.
To learn more about ngrok's Traffic Policy and its capabilities, check out the following resources:
- Learn about the core concepts like phases and rules.
- Check out the examples, use-cases and guides.
- The list of available actions, macros and variables you can use.