Metadata-Version: 2.4
Name: trampoline-client
Version: 0.1.7
Summary: Python client for Trampoline dynamic reverse proxy
Keywords: proxy,tunnel,websocket,nat-traversal
Author: Bobby Lange
Author-email: contact@robertlange.me
Requires-Python: >=3.9,<4.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: httpx (>=0.28.0,<1.0.0)
Requires-Dist: websockets (>=12.0,<20.0)
Description-Content-Type: text/markdown

# Trampoline Client

Python client for [Trampoline](https://github.com/rlange/trampoline) dynamic reverse proxy.

## Installation

```bash
pip install trampoline-client
```

## Usage

```python
from trampoline_client import TrampolineClient
import time

client = TrampolineClient(
    host="wss://t.example.com",
    name="my-service",
    secret="your-secret",
    target="http://localhost:3000"
)

client.start()
time.sleep(1)

if client.connected:
    print(f"Service available at: {client.remote_address}")
    # https://my-service.t.example.com

client.stop()
```

## Load Balancing

```python
for i in range(3):
    client = TrampolineClient(
        host="wss://t.example.com",
        name="my-service",
        existing_ok=True,  # Join existing pool
        target="http://localhost:3000"
    )
    client.start()
```

## Parameters

| Parameter | Description | Default |
|-----------|-------------|---------|
| `host` | Server URL (base domain) | (required) |
| `name` | Tunnel name (becomes subdomain) | (required) |
| `secret` | Auth secret | `None` |
| `target` | Local server to forward to | `http://localhost:80` |
| `existing_ok` | Join existing pool | `False` |
| `daemon` | Daemon thread | `True` |

## Properties

| Property | Description |
|----------|-------------|
| `connected` | Connection active |
| `remote_address` | Public URL (e.g., `https://myapp.t.example.com`) |
| `pool_size` | Workers in pool |

## License

MIT


