An endpoint gives your app a public URL. Start one with the agent:
ngrok http 8080 --url https://api.example.ngrok.appThen add a Traffic Policy to block requests that lack an API key:
1on_http_request:2 - expressions:3 - "!('x-api-key' in req.headers)"4 actions:5 - type: deny6 config:7 status_code: 401| Endpoint type | Starts from | Lives |
|---|---|---|
| Agent | ngrok http | while the agent runs |
| Cloud | the API or dashboard | until you delete it |
Cloud endpoints keep their URL when the agent restarts.
See the endpoints docs for more.