A fast, custom encrypted transport protocol written in Rust.
Go to file
ospab 774d926bf9 chore: bump version to 0.3.3 and add auto-version bumping script to GHA 2026-06-18 02:02:58 +03:00
.github/workflows chore: bump version to 0.3.3 and add auto-version bumping script to GHA 2026-06-18 02:02:58 +03:00
docs feat: update build script and documentation 2026-06-17 03:29:38 +03:00
icons Fix memory leaks, hang issues, gui helper token vulns, and log spam 2026-06-16 14:11:37 +03:00
netstack-smoltcp Fix memory leaks, hang issues, gui helper token vulns, and log spam 2026-06-16 14:11:37 +03:00
ostp chore: bump version to 0.3.3 and add auto-version bumping script to GHA 2026-06-18 02:02:58 +03:00
ostp-client fix: critical buffer and UDP handler improvements 2026-06-17 22:19:20 +03:00
ostp-core Fix CLI setup permissions, enforce global debug tracing, and fix GUI silent startup crash 2026-06-13 01:25:54 +03:00
ostp-flutter chore: version updates and build script tweaks 2026-06-17 19:38:29 +03:00
ostp-gui chore: bump version to 0.3.3 and add auto-version bumping script to GHA 2026-06-18 02:02:58 +03:00
ostp-jni feat: update build script and documentation 2026-06-17 03:29:38 +03:00
ostp-server fix: critical buffer and UDP handler improvements 2026-06-17 22:19:20 +03:00
ostp-tun feat(tun): implement process bypass for TCP/UDP and IP bypass for UDP using existing Extended tables 2026-06-14 00:02:08 +03:00
ostp-tun-helper Fix memory leaks, hang issues, gui helper token vulns, and log spam 2026-06-16 14:11:37 +03:00
ostp-wiki fix: critical buffer and UDP handler improvements 2026-06-17 22:19:20 +03:00
scripts chore: bump version to 0.3.3 and add auto-version bumping script to GHA 2026-06-18 02:02:58 +03:00
.gitattributes chore: enforce LF line endings on bash scripts via gitattributes to fix 'bad interpreter' on Linux 2026-05-15 19:08:03 +03:00
.gitignore feat: update build script and documentation 2026-06-17 03:29:38 +03:00
CONTRIBUTING.md docs: add CONTRIBUTING guide in English and Russian, link in README 2026-05-29 00:25:40 +03:00
CONTRIBUTING.ru.md docs: add CONTRIBUTING guide in English and Russian, link in README 2026-05-29 00:25:40 +03:00
Cargo.lock chore: bump version to 0.3.3 and add auto-version bumping script to GHA 2026-06-18 02:02:58 +03:00
Cargo.toml chore: bump version to 0.3.3 and add auto-version bumping script to GHA 2026-06-18 02:02:58 +03:00
Cross.toml CI/CD: Resolve MIPS Tier-3 compilation by instructing Cross to dynamically build-std library from source 2026-05-14 23:57:19 +03:00
LICENSE Initial public release: Ospab Stealth Transport Protocol v0.1.0 2026-05-14 21:41:54 +03:00
MIGRATION_V0_3_1.md docs: Update config format to modular architecture v0.3.1 2026-06-16 18:09:46 +03:00
README.md fix: critical buffer and UDP handler improvements 2026-06-17 22:19:20 +03:00
README.ru.md fix: critical buffer and UDP handler improvements 2026-06-17 22:19:20 +03:00
app-icon.svg Refactor: Phase 1 and 2 - Async architecture, JNI fixes, SmolTCP data races, and Tunnel optimizations 2026-06-03 02:06:06 +03:00
server.json Remove built-in DNS server and owndns features 2026-06-10 22:52:35 +03:00

README.md

OSTP — Ospab Stealth Transport Protocol

Русский язык · Wiki · Contributing · Releases · Migration Guide

GitHub Release License: BSL 1.1 Platform: Windows | Linux | macOS | Android Crypto Transport

A fast, custom encrypted transport protocol written in Rust.

OSTP (Ospab Stealth Transport Protocol) is a high-performance transport protocol. It implements a custom ARQ transport over UDP, as well as a UoT (UDP-over-TCP) mode. Every byte on the wire — including packet headers — is cryptographically indistinguishable from random noise, making it highly resistant to Deep Packet Inspection (DPI).

[!IMPORTANT] Upgrading from v0.2.x? Please read the v0.3.1 Configuration Migration Guide.


Quick Install

Linux

bash <(curl -Ls https://raw.githubusercontent.com/ospab/ostp/master/scripts/install.sh)

Windows (PowerShell, run as Administrator)

irm https://raw.githubusercontent.com/ospab/ostp/master/scripts/install.ps1 | iex

Manual Download

Download pre-built binaries for your platform from GitHub Releases.


Key Features

Feature Description
Full Traffic Obfuscation Every packet — including headers — is indistinguishable from random noise. Session IDs and nonces are masked with per-packet HMAC-derived keys.
Noise Protocol Handshake Noise_NNpsk0_25519_ChaChaPoly_BLAKE2s — PSK-authenticated, forward-secret key exchange with no static identity exposure.
Reliable UDP (ARQ) Selective ACK/NACK with rate-limited retransmission, configurable reorder buffer, and exponential backoff.
Multiplexed Streams Multiple logical TCP streams over a single encrypted UDP session with per-stream flow control.
Seamless Roaming Clients can switch networks (WiFi ↔ LTE) without session interruption — tracked by session-ID, not IP.
Management API Built-in REST API for third-party panels (3x-ui, custom dashboards). Per-user stats, traffic limits, key CRUD.
Fallback Server TCP fallback proxy to a web server — makes OSTP indistinguishable from nginx during active probing.
Multi-Listener Bind to multiple addresses simultaneously (dual-stack IPv4/IPv6, multi-port).
TUN Mode Full-system VPN via native smoltcp network stack without external dependencies. All traffic transparently routed through the tunnel.
xHTTP Stealth (UoT) UDP-over-TCP tunnel that completely hides traffic. Since all data is fully encrypted and length-prefixed, it bypasses DPI filters that block unknown UDP traffic by riding over a plain TCP connection.
Mobile & Web Apps Beautiful cross-platform mobile client (Flutter) and a modern Web Control Panel (React/Vite) for effortless server and client management.
TURN Relay RFC 5766 TURN support for environments where direct UDP is blocked.
Hot-Reload Runtime config reload without restart (access keys, exclusions, mux settings).
Structured Logging tracing-based logging with RUST_LOG filtering. JSON/file/syslog output support.
Cross-Platform Windows, Linux, macOS, Android, FreeBSD, MIPS, RISC-V. Single binary, no runtime dependencies.

Architecture

graph TD
    subgraph Client ["Client"]
        A[Browser / Apps] -->|SOCKS5 / HTTP| B(Bridge Multiplexer)
        TUN[TUN Interface] -->|IP Packets| B
        
        subgraph OSTPCoreClient ["OSTP Core Protocol"]
            B --> C{Protocol Machine}
            C -->|Noise Handshake| D[ChaCha20Poly1305 AEAD]
            D -->|Obfuscated UDP Payload| E((UDP Socket))
        end
    end

    E <==>|Encrypted & Obfuscated UDP Tunnel| F

    subgraph Server ["Server"]
        F((UDP Socket)) --> G{Dispatcher}
        
        subgraph OSTPCoreServer ["OSTP Core Backend"]
            G -->|Auth & Decrypt| H[Session & State Guard]
            H -->|TCP Stream| I[Relay Loop]
        end
        
        G -->|Active Probing / Unauth| FB[TCP Fallback Proxy]
        FB -->|Forward| NGINX[nginx / Caddy]
        
        H -->|Stats & Traffic| API[Management API]
        
        I -->|Outbound| WWW((Internet))
    end

Quick Start

1. Generate config

# On your VPS (server):
./ostp --init server

# On your machine (client):
./ostp --init client

2. Edit config

Server — set your access keys:

{
  "mode": "server",
  "listen": "0.0.0.0:50000",
  "access_keys": ["YOUR_SECRET_KEY"],
  "api": { "enabled": true, "bind": "127.0.0.1:9090", "token": "admin-token" },
  "fallback": { "enabled": false, "listen": "0.0.0.0:443", "target": "127.0.0.1:8080" }
}

Client — point to your server:

{
  "mode": "client",
  "version": "0.3.1",
  "log": { "level": "info" },
  "inbounds": [
    { "type": "local_proxy", "tag": "socks-in", "protocol": "socks", "listen": "127.0.0.1", "port": 1088 },
    { "type": "tun", "tag": "tun-in", "auto_route": false, "mtu": 1140 }
  ],
  "outbounds": [
    {
      "type": "ostp",
      "tag": "proxy",
      "server": "YOUR_SERVER_IP",
      "port": 50000,
      "access_key": "YOUR_SECRET_KEY",
      "transport": { "type": "udp" }
    },
    { "type": "direct", "tag": "direct" },
    { "type": "block", "tag": "block" }
  ],
  "routing": {
    "rules": [
      { "domain_suffix": ["localhost"], "outbound": "direct" }
    ],
    "default_outbound": "proxy"
  }
}

Note: Upgrading from v0.2.x? Read the v0.3.1 Migration Guide.

3. Run

./ostp                        # Uses config.json in current directory
./ostp --config /path/to.json # Custom config path
./ostp --check                # Validate config without running
./ostp --generate-key         # Generate a new access key
./ostp --links                # Print client share links
./ostp "ostp://ACCESS_KEY@server.com:50000?..."

[!WARNING] Always wrap the ostp://... link in quotes (") so your terminal doesn't misinterpret special characters like & or ?.


Management API

Built-in REST API for building panels and dashboards.

# Server status
curl -H "Authorization: Bearer mytoken" http://127.0.0.1:9090/api/server/status

# List all users with traffic stats  
curl -H "Authorization: Bearer mytoken" http://127.0.0.1:9090/api/users

# Create a user with 10GB traffic limit
curl -X POST -H "Authorization: Bearer mytoken" \
  -H "Content-Type: application/json" \
  -d '{"limit_bytes": 10737418240}' \
  http://127.0.0.1:9090/api/users

Full API reference: Management API


CLI Reference

ostp [OPTIONS] [URL]

Options:
  --config <PATH>        Config file path (default: config.json)
  --init <MODE>          Generate template config (server/client)
  --check                Validate configuration and exit
  -g, --generate-key     Generate a secure access key
  -c, --count <N>        Number of keys to generate (default: 1)
  --format <FMT>         Key format: hex, base64 (default: hex)
  --links                Print client share links from server config

Arguments:
  [URL]                  Connect via share link: ostp://KEY@HOST:PORT

Protocol Summary

Layer Mechanism
Key Exchange Noise NNpsk0 (X25519 + ChaChaPoly + BLAKE2s) zero-RTT
Encryption ChaCha20-Poly1305 AEAD per-packet
Header Obfuscation HMAC-SHA256 derived per-packet mask
Reliability Selective ACK with cumulative + SACK ranges
Retransmission Rate-limited NACK + exponential backoff RTO
Keepalive Ping/Pong with RTT measurement every 5s

Building from Source

# Prerequisites: Rust 1.75+
cargo build --release

# Cross-compile for Linux
cross build --release --target x86_64-unknown-linux-gnu

# Run tests
cargo test -p ostp-core -p ostp-server

Documentation


License

Business Source License 1.1. Free for personal and non-commercial use.
Converts to MIT License on May 14, 2030.


Contact