GoSuda

Portalite: A Lightweight Portal Go SDK with Multi-Relay Binding and Standard net.Listener Support

By Lemon Mint views ...

Earlier, when introducing Portal, we discussed the problems of the modern web. With the advent of AI coding tools, anyone can now build a website, yet publishing it to the world remains the exclusive domain of large platforms and cloud providers. Portal separates web hosting from content creation and connects personal local services to the entire world through end-to-end encrypted relays, returning the authority to publish to individuals.

Announcing Portalite

Today, I am announcing Portalite. Portalite is an ultra-lightweight Portal client and Go SDK built with minimal dependencies.

If Portal is the philosophy of "how to change the web," Portalite is the thinnest adhesive that attaches that philosophy to a developer's app. Developers can add a portal ingress to their app without complex cloud configuration or deployment pipelines, simply by importing the SDK and adding a few lines of code. The moment the app runs, a server that existed only locally becomes a public service accessible from anywhere on the internet.

1. A Public Ingress Completed in Two Lines of Code

Portalite supports net.Listener, Go's standard interface. It works immediately by simply replacing the listener in an existing web framework or server code.

1identity, err := portalite.GenerateIdentity("my-service")
2
3listener, err := portalite.Expose(ctx, portalite.ExposeConfig{
4    Relays:   portalite.DefaultRelays(),
5    Identity: identity,
6})
7
8http.Serve(listener, handler)
  • Zero-config: No port forwarding, static IP, or firewall inbound rule configuration is required at all.
  • Standard compatibility: It is 100% compatible with every Go library that uses the standard net.Listener, including http.Server, grpc.Server, Gin, Echo, and Chi.

2. Core Feature: Multi-Relay Binding

Most tunneling tools depend on a single endpoint, so when the relay server goes down, the service is disconnected along with it. Portalite connects to multiple relay servers simultaneously and operates across them.

  • Seamless fault isolation (Failover): Even if some of the multiple relays go down or experience network latency, the remaining live relays continue to accept traffic through the same virtual listener.
  • Elimination of the single point of failure (SPOF): Unless all relay sessions are disconnected at the same time, the application's Accept() loop is not interrupted.
  • End-to-end encryption (E2EE): Traffic is relayed in encrypted form, so relay servers cannot inspect or tamper with the data.
  • Automatic reconnection and self-healing: Even during temporary network disconnections or relay reboots, sessions and tokens are automatically renegotiated in the background to restore the connection.

3. Immediate Use with a Single CLI Command

If you are not writing Go code or need a quick test, you only need to pass a port number to the CLI.

1$ go install gosuda.org/portalite/cmd/portalite@latest && portalite expose --name "my-service" 3000
2URL https://my-service.rly.best
3URL https://my-service.s-h.day
4

Immediately upon running the command, URLs for multiple relays are issued, and the service becomes accessible from outside right away.

4. Lightweight Yet Powerful Features

  • Minimal dependencies: By removing third-party dependencies, the binary is lightweight and builds quickly.
  • TLS & UDP support: Beyond TLS traffic such as HTTP/gRPC, UDP services such as game servers can also be easily exposed through QUIC datagram backhauling.

Getting Started