v1-ch
A FastAPI-based proxy server supporting multiple protocols for secure network connectivity.
Features
- Multi-Protocol Support: Shadowsocks WebSocket, Trojan, VLESS relay, MTProto, and XHTTP
- Web Interface: FastAPI-powered dashboard with CORS support
- Persistent Configuration: State management with disk-based persistence
- WebSocket Support: Real-time communication capabilities
- Security: Built-in secret key management and cryptographic functions
Tech Stack
- Framework: FastAPI 0.104.1 with Uvicorn ASGI server
- Networking: HTTPX client with HTTP/2 support, WebSockets 12.0
- Cryptography: Advanced encryption libraries
- File I/O: Async file operations with aiofiles
- Timezone: Iran timezone (Asia/Tehran) support
Protocol Modules
shadowsocks_ws.py - Shadowsocks over WebSocket implementation
trojan.py - Trojan protocol handler
relay_vless.py - VLESS protocol relay
mtproto.py - MTProto protocol support
xhttp_siz10.py - XHTTP protocol implementation
Quick Start
# Install dependencies
pip install -r requirements.txt
# Run the server
python main.py
Configuration
The application uses persistent storage in /data directory with automatic secret key generation. State is maintained across restarts via JSON serialization.
Environment Variables:
DATA_DIR - Data directory path (default: /data)
SECRET_KEY - Optional pre-set secret key
API
FastAPI application with disabled documentation endpoints (docs_url=None) for security. CORS enabled for cross-origin requests.