Ngrok, a Kubernetes ingress controller, has a new package out that enables developers to embed ingress into Go applications.

Go developers can use ngrok-go to serve their Go apps with little coding required as they won’t have to set up with network primitives like IPs, certificates, load balancers, and ports. 

Calling the ngrok.Listen() function will initiate a persistent outbound TLS connection to ngrok’s platform and transmit network configuration information. Then, the ngrok service will set up that configuration across all of its global points and return a URL for the application. 

Once this is setup, whenever ngrok receives HTTP requests, it will receive them at the closest region to the requester. Unauthorized requests will be blocked at the edge so that only valid requests are sent to an ngrok-go app. 

According to ngrok, setting up ingress without tools like this can be frustrating because it requires dealing with a variety of low level networking primitives, forcing developers to closely work with the assembly language of networking, rather than just focusing on their own code. By abstracting that away, developers can still specify ingress without having to work with low-level details and without sacrificing security or control. 

Ngrok-go also decouples ingress from the environment an app runs in. In other words, apps that use ngrok-go can be run anywhere and it will still receive traffic the same way. 

“From an ingress standpoint, your application becomes portable: it does not matter whether it runs on bare metal, VMs, AWS, Azure, in Kubernetes, serverless platforms like Heroku or Render, a racked data-center server, a Raspberry Pi, or on your laptop,” Alan Shreve, founder and CEO of ngrok wrote in a blog post

Another consideration when developing ngrok-go was wanting to enable ingress without side cars. According to ngrok, developers typically deploy the ngrok agent alongside their applications, but it can be challenging to bundle and manage it. Ngrok-go eliminates the agent, which helps to simplify distribution and management. 

Currently the ngrok team is also working on support for other languages to get their own package. Rust and JavaScript are actively being worked on, and in the future they hope to create ngrok packages for Java, C#, Python, and Ruby as well.