Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates cloud endpoint forwarding guide #1108

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kaganjd
Copy link
Contributor

@kaganjd kaganjd commented Jan 4, 2025

preview lives here: https://ngrok-docs-git-jen-clep-routing-update-ngrok-dev.vercel.app/docs/guides/other-guides/forwarding-and-load-balancing-with-cloud-endpoints/

  • cloud endpoints are no longer in private beta (removed this wording from a few other places too, and added that endpoint pools are in private beta)
  • we have UI for this feature now, which we didn't used to- updated guide relies on our dashboard instead of the API/CLI
  • reorder the steps

Copy link

vercel bot commented Jan 4, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
ngrok-docs ✅ Ready (Inspect) Visit Preview Jan 8, 2025 0:10am

Copy link
Collaborator

@S3Prototype S3Prototype left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this! Just a few suggested changes I'd like to get your input on.

Have you tested the examples? I have to step away from the PC but will test them when I get back

...
}
```
To follow this guide, you will need a computer with `ngrok` installed. [You can download ngrok here.](https://download.ngrok.com).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To follow this guide, you will need a computer with `ngrok` installed. [You can download ngrok here.](https://download.ngrok.com).
To follow this guide, you will need a computer with `ngrok` installed. [You can download ngrok here.](https://download.ngrok.com)

Removed extra period

}
BODY
```
Visit https://dashboard.ngrok.com/domains and reserve a domain. This will be how your end users access your endpoint in the browser.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Visit https://dashboard.ngrok.com/domains and reserve a domain. This will be how your end users access your endpoint in the browser.
Reserve a domain [in the dashboard](https://dashboard.ngrok.com/domains). This will allow your end users access your endpoint in the browser.

Mostly language cleanup for simplification. Is a browser the only way a user can access an ngrok endpoint with a reserved domain? If not, we should drop "in the browser" from the end of the sentence in my opinion

...
}
```
Once you've reserved a domain, visit https://dashboard.ngrok.com/endpoints to create a public endpoint linked to that domain
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Come to think of it, maybe we should combine these two steps into one called "Reserve a domain and a cloud endpoint" since they're very simple. It could look like this:

## **Step 1** – Reserve a domain and create a cloud endpoint

You can complete these steps in the ngrok dashboard.

1. [Reserve a domain](https://dashboard.ngrok.com/domains). This will allow your end users access your endpoint in the browser.
2. [Create a public endpoint](https://dashboard.ngrok.com/endpoints) linked to your reserved domain.

Could be nice to add a sentence to the end of the 2nd item explaining the point of creating a public endpoint

handle incoming traffic. This guide will showcase one of the simplest
and most common use cases: forwarding traffic to other endpoints
(the internal endpoint we created in Step 1) via the forward action.
Cloud endpoints require a traffic policy so they know how to handle incoming traffic. This guide will showcase one of the simplest and most common use cases: forwarding traffic to a private endpoint via the `forward-internal` action.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Cloud endpoints require a traffic policy so they know how to handle incoming traffic. This guide will showcase one of the simplest and most common use cases: forwarding traffic to a private endpoint via the `forward-internal` action.
Cloud endpoints require [traffic policies](/traffic-policy/) to manage incoming traffic. The following is an example of a traffic policy that forwards traffic to a private endpoint via the [`forward-internal`](/traffic-policy/actions/forward-internal/) action.

Simplification

Now we can create a ngrok Cloud Endpoint that points to our
newly created internal endpoint. Cloud Endpoints can be created
via the API or ngrok dashboard.
At this point, you have a public endpoint with a domain and a traffic policy routing to the URL we defined in our traffic policy above, `https://the-internal-endpoint.internal`. But that URL doesn't exist on the public internet; we need to start an agent session so that requests to our public endpoint will be routed to our internal endpoint, served by the ngrok agent. So, locally, start an agent session with:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
At this point, you have a public endpoint with a domain and a traffic policy routing to the URL we defined in our traffic policy above, `https://the-internal-endpoint.internal`. But that URL doesn't exist on the public internet; we need to start an agent session so that requests to our public endpoint will be routed to our internal endpoint, served by the ngrok agent. So, locally, start an agent session with:
Finally, to accept requests routed to your internal endpoint, you must start an ngrok agent locally on the machine or resource you want to use with the following command.

I heavily simplified this, but let me know if I've made it inaccurate. I appreciate that the wording was deliberate to make what's happening clearer, but I personally found it harder to process than a more streamlined explanation

```

## Conclusion

And we're done! You've successfully created a cloud endpoint that can be accessed from the URL you reserved: `${NGROK_SUBDOMAIN}.ngrok.app`
The cloud endpoint will refer to its traffic policy and forward traffic to our internal endpoint. The internal endpoint finally exposes the local port on which it was created on in Step 1.
And you're done! You've successfully created a cloud endpoint that can be accessed from the URL you reserved. The cloud endpoint will refer to its traffic policy and forward traffic to our internal endpoint. The internal endpoint finally exposes the local port on which it was created on in Step 1.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally think we should cut this section, as it's just repitition


- Replace NGROK_SUBDOMAIN with the value used in step 2.
## **Step 5** — See your endpoint in action
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would make this a separate section called "Load balancing internal endpoints". It's not really a step in the guide, as the user is already done. Also, the previous step is already labeled Step 5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants