Metadata-Version: 2.4
Name: smart-proxy-multiplexer
Version: 1.0.1
Summary: Universal asyncio multiplexer for TLS, SOCKS5, and HTTP CONNECT on a single port
Author-email: Valentin Voltecc <volttecc@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/VoltaStrasse/smart-proxy-multiplexer
Project-URL: Repository, https://github.com/VoltaStrasse/smart-proxy-multiplexer
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Topic :: Internet :: Proxy Servers
Classifier: Topic :: System :: Networking
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Dynamic: license-file

# Smart Proxy Multiplexer

[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)
[![Python](https://img.shields.io/badge/python-3.10%2B-blue)](https://python.org)
[![Status](https://img.shields.io/badge/status-production_ready-brightgreen)]()
[![PyPI](https://img.shields.io/pypi/v/smart-proxy-multiplexer)](https://pypi.org/project/smart-proxy-multiplexer/)
[![Tests](https://github.com/VoltaStrasse/smart-proxy-multiplexer/actions/workflows/tests.yml/badge.svg)](https://github.com/VoltaStrasse/smart-proxy-multiplexer/actions/workflows/tests.yml)

A lightweight, high-performance Python library that handles **TLS, SOCKS5, and HTTP CONNECT** simultaneously on a single port.

## Features

- 🔄 **Protocol auto‑detection** – reads the first byte to route TLS, SOCKS5, or HTTP
- 🔒 **Native TLS termination** – uses your own SSL certificates
- 🌐 **DoH proxying** – intercepts DNS‑over‑HTTPS to Google DNS
- 🎭 **Traffic masking** – returns HTML on plain GET requests
- 🚀 **Async/await** – built on asyncio for high concurrency
- 🔗 **Parent proxy chaining** – supports SOCKS5/HTTP upstream
- 📦 **Zero external dependencies** – only Python 3.10+ standard library

## Installation

```bash
pip install smart-proxy-multiplexer
Quick Start
python
from smart_proxy import ProxyMultiplexer
import asyncio

async def my_auth(login, password):
    if login == "demo" and password == "demo":
        return {"host": "192.168.1.100", "port": 1080, "login": "user", "password": "pass"}
    return None

mux = ProxyMultiplexer(
    host="0.0.0.0",
    port=8443,
    auth_callback=my_auth,
)

asyncio.run(mux.start())
How It Works
text
Client (TLS/SOCKS5/HTTP) → [Port 443] → Multiplexer → Parent SOCKS5 → Internet
                                          │
                                          ├─ DoH requests → Google DNS (8.8.8.8)
                                          └─ GET without auth → HTML page
```
## Running Tests

The library includes a comprehensive test suite using `pytest`.

1. Install development dependencies:
```bash
  pip install -e .[dev]
```

2. Run the tests:
```bash
   pytest tests/test_multiplexer.py -v
   ```

All tests are isolated and run on random ports. No external services are required.

License
MIT © 2026 Valentin Volttecc

Contact
Email: volttecc@gmail.com

Telegram: @volttecc

GitHub: VoltaStrasse
