rstream SDKs

Embed rstream tunnels in your application

Create published endpoints, dial private services, and own the connection lifecycle from Go, JavaScript, Python, Java, or C++. Every client uses the same project, identity, and zero-trust policy model.

Integration surfaces

Integrate rstream across your existing stack

Add rstream at the layer your stack already owns, from infrastructure and application code to automation and agent workflows. Every path uses the same project and identity model.

Works with the frameworks your applications already use

  • Node.js
  • Next.js
  • Express
  • Django
  • Flask
  • FastAPI
  • Laravel
  • ASP.NET Core
  • Spring Boot
  • Ruby on Rails

Tunnel lifecycle options

Keep tunnel lifecycle with your infrastructure tooling or with the application process that owns the workload.

01

CLI and controllers

Infrastructure-managed tunnels

Run tunnels from the CLI, or reconcile YAML, Docker labels, and Kubernetes resources with run and watch controllers.

02

Client SDKs

Application-owned tunnel lifecycle

Create, serve, dial, and close tunnels from the process that already owns the workload.

Automation access options

Use standard APIs and live watch streams, or give agents scoped access through MCP and Agent Skills.

01

APIs and watch streams

Control-plane automation and live state

Use the Control plane API for managed projects and the Engine API for project-scoped inventory, events, and operations.

02

MCP and Agent Skills

Scoped workflows for AI agents

Agents discover rstream, request scoped permissions, and operate managed or local workflows through product-native tools.

Explore implementation details for tunnel controllers, APIs, and agent workflows.

Language runtimes

Choose the SDK for your runtime

rstream provides open-source clients for Go, JavaScript, Python, Java, and C++. Each follows its ecosystem's native server and concurrency model and is designed with performance and security as first-class concerns.

JavaScript

Node.js products, managed APIs, and browser tooling

Code samples

Own the tunnel lifecycle in application code

Inspect complete, runnable projects with source, manifests, dependencies, and build files. Each example resolves the project, opens a published HTTP tunnel, serves through its native runtime, and shuts down cleanly with the process.

package main

import (
	"context"
	"errors"
	"fmt"
	"log"
	"net"
	"net/http"
	"os"
	"os/signal"
	"syscall"
	"time"

	"github.com/rstreamlabs/rstream-go"
	"github.com/rstreamlabs/rstream-go/config"
)

func main() {
	ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
	defer stop()
	client, err := config.NewClientFromEnv()
	if err != nil {
		log.Fatal(err)
	}
	ctrl, err := client.Connect(ctx, nil)
	if err != nil {
		log.Fatal(err)
	}
	defer ctrl.Close()
	tunnel, err := ctrl.CreateTunnel(ctx, rstream.TunnelProperties{
		Protocol:    rstream.ProtocolPtr(rstream.ProtocolHTTP),
		HTTPVersion: rstream.HTTPVersionPtr(rstream.HTTP1_1),
		Publish:     rstream.BoolPtr(true),
	})
	if err != nil {
		log.Fatal(err)
	}
	defer tunnel.Close()
	addr, _ := tunnel.ForwardingAddress()
	fmt.Printf("Server accessible at: %s\n", addr)
	hostname, err := os.Hostname()
	if err != nil {
		hostname = "unknown"
	}
	listener, ok := tunnel.(net.Listener)
	if !ok {
		log.Fatal("tunnel does not implement net.Listener")
	}
	handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		w.Header().Set("Content-Type", "text/plain")
		fmt.Fprint(w, hostname)
	})
	server := &http.Server{Handler: handler}
	errCh := make(chan error, 1)
	go func() {
		errCh <- server.Serve(listener)
	}()
	select {
	case <-ctx.Done():
		shutdownCtx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
		defer cancel()
		if err := server.Shutdown(shutdownCtx); err != nil && !errors.Is(err, http.ErrServerClosed) {
			log.Fatal(err)
		}
	case err := <-errCh:
		if err != nil && !errors.Is(err, http.ErrServerClosed) && !errors.Is(err, net.ErrClosed) {
			log.Fatal(err)
		}
	}
}

Capability coverage

Compare capabilities across SDKs

All five SDKs cover published bytestream tunnels, private dialing, and mTLS identity. Native server integrations and advanced runtime or platform surfaces vary by ecosystem and remain explicit below.

CapabilityGoJavaScriptPythonJavaC++
Published bytestream tunnels
Private bytestream dialing
Native HTTP integrationnet/httpNode HTTPASGI + WSGIDirect handlerBoost.Beast
Datagram tunnelsPublished + private
Managed project resolution
Engine inventory and watch streams
Browser and React integrationsWebTTY + React
mTLS identity

The Go SDK is the reference runtime. Other SDKs prioritize the workflows native to their ecosystems; their documentation defines the current API boundaries.

Production systems

Reference implementations with rstream SDKs

Explore working architectures that combine SDK code with identity, discovery, routing, TURN, and operational state across local, cloud, and device environments.

Start with an rstream SDK

CLI installation · View all methods

/bin/sh -i -c "$(curl -fsSL https://rstream.io/scripts/install.sh)"