Metadata-Version: 2.4
Name: aitun
Version: 4.9.17
Summary: AiTun - Secure tunnel service that exposes local servers to the public internet, supporting IPv6/IPv4 P2P and relay modes
Project-URL: Homepage, https://aitun.cc
Project-URL: Documentation, https://aitun.cc
Project-URL: Repository, https://github.com/samaidev/aitun
Author-email: AiTun <admin@aitun.cc>
License-Expression: MIT
Keywords: aitun,nat-traversal,ngrok,p2p,reverse-proxy,tunnel
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Internet :: Proxy Servers
Classifier: Topic :: System :: Networking
Requires-Python: >=3.7
Description-Content-Type: text/markdown

# AiTun

AiTun - Secure tunnel service that exposes local servers to the public internet, supporting IPv6/IPv4 P2P and relay modes.

## Installation

```bash
pip install aitun
```

## Usage

```bash
# Quick start - expose local port 8080 (free tunnel, no sign-up)
aitun -p 8080

# With explicit server
aitun -s aitun.cc:6639 -p 8080

# With auth token (registered subdomain)
aitun -k YOUR_TOKEN -p 8080

# With TCP forwarding (SSH + MySQL)
aitun -k YOUR_TOKEN -p 8080 --tcp-ports 22,3306

# Run as daemon
aitun -p 80 --daemon

# Stop daemon
aitun --stop
```

## CLI Flags

| Flag | Description |
|---|---|
| `-p PORT` | Local service port (default: 0 = no HTTP port; TCP-only mode with `--tcp-ports`) |
| `-k TOKEN` | Auth token for registered subdomain (omit for free tunnel) |
| `-s SERVER` | Server address (default: aitun.cc:6639) |
| `--host HOST` | Local service address (default: localhost) |
| `--tcp-ports PORTS` | TCP forwarding ports, comma-separated (requires `-k`) |
| `--p2p` | Enable P2P direct connection (default: enabled) |
| `--no-p2p` | Disable P2P, force server relay mode |
| `--daemon` | Run as background daemon |
| `--stop` | Stop running daemon |

## Modes

- **Free Tunnel**: Instant proxy URL like `aitun.cc/abc123` (no sign-up, 24h validity)
- **Subdomain**: Custom subdomain like `myapp.t.aitun.cc` (HTTPS, requires sign-in)
- **Short Domain**: Short subdomain like `myapp.aitun.cc` (requires sign-in)
- **TCP Forwarding**: Forward SSH, MySQL, etc. via SNI routing (requires `-k` and `--tcp-ports`)
- **SSH ProxyCommand**: Use `aitun ssh-proxy host.t.aitun.cc 22` to wrap SSH in TLS for subdomain routing

## License

MIT
