rstream Python SDK
rstream connects services and devices through outbound connections, so they can be reached without opening inbound ports on their hosts. This SDK embeds that connection in a Python application, without a separate agent process.
Its async API fits asyncio services and workers. ASGI and WSGI adapters serve an existing web application directly over accepted tunnel streams; the same SDK can dial private services and verify webhook deliveries.
The package is named rstreamlabs-rstream; import it as rstream. Python 3.10 or newer is required.
Where this SDK fits
An rstream agent connects outbound to the edge, which routes traffic to the application and applies project and tunnel policy. Published tunnels provide a forwarding address; private tunnels are reached by name or ID through an authenticated rstream client.
| Integration | Python support |
|---|---|
| Application servers | Serve HTTP/1.1 through ASGI, WSGI or accepted bytestreams. |
| Existing services | Forward tunnel connections to a local TCP port. |
| Private connectivity | Dial bytestream tunnels by name or ID. |
| Service discovery | Query inventory and watch lifecycle events with optional HTTP dependencies. |
| Webhooks | Verify signatures and parse deliveries in your framework. |
The runtime connects to the engine over TLS. Datagram tunnels, QUIC runtime transport and HTTP/3 tunnel creation are outside this SDK’s current scope. The SDK guide compares the available language and protocol choices.
Publish a FastAPI application
Install the package and select a project. This application owns FastAPI startup and shutdown and serves requests directly over the tunnel.
import asyncio
from contextlib import suppress
from fastapi import FastAPI
import rstream
app = FastAPI()
@app.get("/")
async def root() -> dict[str, str]:
return {"status": "ok"}
async def main() -> None:
async with (
app.router.lifespan_context(app),
rstream.Client.from_env() as client,
await client.connect() as control,
):
tunnel = await control.create_tunnel(
protocol="http",
http_version="http/1.1",
publish=True,
)
print("Forwarding address:", tunnel.forwarding_address, flush=True)
await rstream.asgi.serve(app, tunnel)
with suppress(KeyboardInterrupt):
asyncio.run(main())
Run python main.py and open the forwarding address to receive
{"status":"ok"}. The first-application guide
explains how to verify the endpoint and build the checkout.
Documentation
| Task | Guide |
|---|---|
| Install the SDK or build the checkout | Getting started |
| Serve an application or forward an existing port | Choose a tunnel integration |
| Find an equivalent Flask, Django or asyncio example | Example catalog |
| Configure credentials or verify a webhook | Documentation index |
| Develop the SDK | Contributing |
Security and support
Use Security to report vulnerabilities privately. Usage questions and reproducible bugs belong in GitHub issues; remove credentials and customer identifiers before sharing a reproduction. Licensed under Apache-2.0.
Metadata
Release files for rstreamlabs-rstream 0.8.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rstreamlabs_rstream-0.8.2.tar.gz | 106.2 kB | With provenance | Details for rstreamlabs_rstream-0.8.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rstreamlabs_rstream-0.8.2-py3-none-any.whl | Python 3 | none | any | Details for rstreamlabs_rstream-0.8.2-py3-none-any.whl |
Total release size: 163.7 kB
Release files / rstreamlabs_rstream-0.8.2.tar.gz
| Download URL | rstreamlabs_rstream-0.8.2.tar.gz |
|---|---|
| Size | 106.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dc60ffc9c1338b78c84ac8f7aff419b3ea94b1d04c9617e90a004947be7471b6
|
|
BLAKE2b-256 checksum How to use checksums |
8fb5367a092afb896d0bb39c70b5557b1d2091ec3d68a47769eeff02b3d1deb5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logRelease files / rstreamlabs_rstream-0.8.2-py3-none-any.whl
| Download URL | rstreamlabs_rstream-0.8.2-py3-none-any.whl |
|---|---|
| Size | 57.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0a87ac9edab8510e5d366818262c97b796e3718f40fe346a62d2605718865808
|
|
BLAKE2b-256 checksum How to use checksums |
e3441094ba4f03036b1db09c8eab3903f9d63a61f0cd7f0f174c2228cad1c3d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logSecurity for rstreamlabs-rstream 0.8.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for rstreamlabs_rstream-0.8.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.