Skip to main content

neruton (Python SDK & CLI)

Native pure-Python tunnel client & SDK for Neruton — self-hosted intranet penetration, wildcard subdomain reverse proxy, and WebSocket tunneling over port 443 (WSS + Yamux).

  • 100% pure Python (no Rust binary wrapper, no C extensions) implementing the exact Neruton control protocol and Yamux v0 multiplexer byte-for-byte compatible with neruton-server (yamux 0.13).
  • Async & Sync Python APIs with full PEP 561 type annotations (py.typed).
  • Drop-in CLI (neruton and python -m neruton) sharing ~/.config/neruton/config.toml (0600) and NERUTON_SERVER / NERUTON_TOKEN environment variables with the Rust CLI.
  • Full HTTP/1.1 & WebSocket forwarding with Host rewriting, chunked streaming, local HTTPS (--no-tls-verify), automatic reconnect with sticky prefix, and fail-fast on HTTP 401 auth errors.

Installation

pip install neruton

Requires Python 3.9+.

Quick Start — Python SDK

Async API (asyncio / FastAPI / Starlette / aiohttp)

import asyncio
import neruton

async def main() -> None:
    async with neruton.connect(
        url="http://127.0.0.1:3000",
        server="https://neruton.moer.eu.org",
        token="ntk_your_token_here",
        subdomain="my-app",  # optional; auto-assigns UUID v4 if omitted
    ) as tunnel:
        print("Public URL :", tunnel.public_url)
        print("Preview URL:", tunnel.preview_url)
        print("Path URL   :", tunnel.path_url)
        print("Prefix     :", tunnel.prefix)
        await tunnel.wait()

asyncio.run(main())

Shorthand helpers for local ports:

async with neruton.forward(3000, subdomain="my-app") as tunnel:
    print(tunnel.public_url)

# Alias matching `neruton http 8080`:
tunnel = await neruton.http(8080)
try:
    print(tunnel.public_url)
finally:
    await tunnel.close()

Sync API (Flask / Django / Scripts / Notebooks)

neruton.open(...) runs the tunnel's asyncio event loop on a dedicated daemon thread and shuts down cleanly when exiting the with block:

import neruton

with neruton.open(5000, server="https://neruton.moer.eu.org", token="ntk_your_token_here") as tunnel:
    print("Tunnel live at:", tunnel.public_url)
    app.run(port=5000)

Config Helpers

import neruton

print(neruton.config_path())  # ~/.config/neruton/config.toml
neruton.save_config(server="https://neruton.moer.eu.org", token="ntk_your_token_here")
cfg = neruton.load_config()

Quick Start — CLI

# Save default server and tunnel token (writes mode 0600 config.toml)
neruton config set --server https://neruton.moer.eu.org --token ntk_your_token_here
neruton config show
neruton config path

# Forward a local port with an auto-generated UUID v4 subdomain
neruton http 3000

# Forward with a custom subdomain prefix
neruton http 8080 -s my-app
neruton tunnel --url http://127.0.0.1:3000 --subdomain my-app

# Or invoke as a Python module
python -m neruton http 3000
python -m neruton version

License

MIT

Metadata

Release files for neruton 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for neruton 0.2.0
File Size Uploaded Provenance Actions
neruton-0.2.0.tar.gz 51.3 kB Without provenance Details for neruton-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for neruton 0.2.0
File Interpreter ABI Platform Actions
neruton-0.2.0-py3-none-any.whl Python 3 none any Details for neruton-0.2.0-py3-none-any.whl

Total release size: 88.0 kB

Release files / neruton-0.2.0.tar.gz

Download URL neruton-0.2.0.tar.gz
Size 51.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6d01884faca9e1ba704acf521cd89e57d6ea400b3089eeac806cb00740089a8b
BLAKE2b-256 checksum
How to use checksums
53926db1689b3d7797cab7b7fc784005dc14318b5d739f8dea573c77c5395a40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.9

Release files / neruton-0.2.0-py3-none-any.whl

Download URL neruton-0.2.0-py3-none-any.whl
Size 36.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bca8c74769073a2f24f6338d5fc8fe0e93a83625d37ef1660d354cbb9d928ae8
BLAKE2b-256 checksum
How to use checksums
6086d64ff5dfff00efb9e282ff001580448a8416ff698aeb83a871a585056873
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.9

Security for neruton 0.2.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page