August 28, 2023
|
5
min read

Introducing Cloud Edges for all ngrok users

Nijiko Yonskai

We are thrilled to announce the addition of Cloud Edges to our free tier, offering you a centralized way to dynamically add capabilities to your ngrok endpoints without any downtime.

We added Cloud Edges to ngrok’s free tier so that everyone can deliver production apps and APIs on ngrok. 

With Cloud Edges, you start your agent once and then configure it via the dashboard or API. When you make changes to your endpoint’s configuration by adding or updating modules, your app doesn’t go offline. You never have to restart the agent to pick up new command line flags or configuration files. 

Cloud Edges gives you the ability to:

Try it out

To set up an HTTPS edge using ngrok Cloud Edges, follow these steps:

  1. Navigate to Cloud Edges > Edges.
  2. Click Create Edge and choose HTTPS Edge. Your new edge will be assigned its own static domain.
  3. Click “Start a Tunnel'' to get the ngrok agent command needed to send traffic from your new edge to your upstream application. Unlike using ngrok without Edges, you’ll use a command that doesn’t specify module configuration options because that configuration lives in the Edge now. It will look something like this:

ngrok tunnel 80 --label edge=[edge_id]

Now that you’ve started an ngrok agent for your Edge, you can access your application via its endpoint URL. Your endpoint URL is the static domain that was assigned when you created the Edge. It’s at the top of your Edge’s configuration page.

A gif demonstrating how to create an Edge within ngrok

You should note that associating your static domain with an Edge means that you can no longer create agent-initiated endpoints on it via the CLI. To do so, you must first delete the associated edge for your static domain.

Add more functionality

With your edge up and running, we can easily add new functionality with modules like OAuth, Circuit Breaker and Compression without restarting the agent. Here is a demonstration of how easy it is to quickly integrate GitHub login via OAuth on your Edge:

A gif demonstrating add GitHub OAuth to your Edge within ngrok

Now that you’ve added Github login to your Edge, try visiting your URL again and it will prompt you to login through Github. The power of Cloud Edges is that you don't have to restart your agent and take your app offline to apply this new configuration.

Using Edges with ngrok SDKs

You can also use ngrok Cloud Edges in your Go or Rust applications using our ngrok-go or ngrok-rust agent SDKs. There’s no need to hardcode details about the Edge or endpoint’s configuration in the code. This is all maintained at the Edge. Your Go or Rust application will automatically be able to take advantage of new or updated modules configured using the Edge.

Here’s an example of using edges with the ngrok-go SDK:


package main

import (
	"context"
	"fmt"
	"log"
	"net/http"

	"golang.ngrok.com/ngrok"
	"golang.ngrok.com/ngrok/config"
)

func main() {
	tun, err := ngrok.Listen(context.Background(),
		config.LabeledTunnel(config.WithLabel("edge", "[YOUR_EDGE_LABEL]")),
		ngrok.WithAuthtokenFromEnv(),
	)
	if err != nil {
		log.Fatal(err)
	}
	log.Println("Application available at:", tun.URL())
	err := http.Serve(tun, http.HandlerFunc(handler))
	if err != nil {
		log.Fatal(err)
	}
}

func handler(w http.ResponseWriter, r *http.Request) {
	fmt.Fprintln(w, "Hello from ngrok-go!")
}

Start delivering production-grade applications

We just launched static domains for our free users and added Cloud Edges to ngrok’s free tier so that everyone can deliver production apps and APIs on ngrok. For developers, Cloud Edges unlocks a whole array of new capabilities on top of the existing ngrok platform. For IT and SecOps teams, it provides the control and governance needed to manage users at scale.

If you don’t yet have an account, you can sign up for an account here. Let us know if you run into any problems or have any questions. You can reach us on Twitter, the ngrok community on Slack or at support@ngrok.com.

‍

Share this post
Nijiko Yonskai
Niji is a Senior Product Manager at ngrok helping shape ngrok user experience. Previously product at Kong and Postman. Outside of work Niji is an amateur pasta chef, early-stage investor, writer and open-source developer.
Cloud edge
OAuth
Features
Development