Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Flowseal/tg-ws-proxy/llms.txt

Use this file to discover all available pages before exploring further.

Building from source gives you the latest unreleased changes and full control over the runtime environment. TG WS Proxy is a standard Python package managed with Hatch, so a single pip install -e . command installs everything and registers all entry points. Python 3.8 or later is required.

Console Proxy

To run the headless proxy without any system tray or GUI components, install the package in editable mode and invoke the tg-ws-proxy entry point:
pip install -e .
tg-ws-proxy
The proxy starts on 127.0.0.1:1443 by default and prints the connection link to stdout. A full list of CLI flags is available with tg-ws-proxy --help.

CLI Arguments

ArgumentDefaultDescription
--port1443Port the proxy listens on
--host127.0.0.1Interface address the proxy binds to
--secret(random)32-character hex key for client authentication
--dc-ip DC:IP2:149.154.167.220, 4:149.154.167.220Target IP for a Telegram DC; repeat the flag for multiple DCs
--fake-tls-domainEnable Fake TLS (ee-secret) camouflage with the given SNI domain
--no-cfproxyfalseDisable automatic Cloudflare proxying
--cfproxy-domainCustom domain for Cloudflare proxying (repeatable)
--cfproxy-worker-domainCloudflare Worker domain (repeatable)
--proxy-protocoloffAccept HAProxy PROXY protocol v1 (for use behind nginx/haproxy)
--buf-kb256Socket buffer size in KB
--pool-size4Pre-warmed connections per DC
--log-filePath to a log file
--log-max-mb5Maximum log file size in MB before rotation
--log-backups0Number of rotated log files to keep
-v, --verboseoffEnable DEBUG-level logging
Examples:
# Standard run with defaults
tg-ws-proxy

# Custom port with additional DCs
tg-ws-proxy --port 9050 --dc-ip 1:149.154.175.205 --dc-ip 2:149.154.167.220

# Verbose logging
tg-ws-proxy -v

# Fake TLS camouflage
tg-ws-proxy --fake-tls-domain example.com

Tray Apps

Platform-specific tray applications bundle the proxy with a GUI and are launched via dedicated entry points:
pip install -e .
tg-ws-proxy-tray-win
Runs the proxy with a Windows system tray icon, settings dialog, and autostart registry integration. Supports Windows 7 and Windows 10+.

Dependencies

Key dependencies installed by pip install -e . (from pyproject.toml):
PackagePlatformsPurpose
cryptographyAllMTProto cryptographic operations
psutilAllProcess and network utilities
pyperclipAllClipboard access for the Copy Link action
PillowAllTray icon image handling
pystrayWindows, LinuxSystem tray integration
customtkinterWindows, LinuxSettings and first-launch GUI dialogs
rumpsmacOSNative macOS menubar framework
On Windows with Python < 3.9, slightly older pinned versions of psutil, cryptography, and Pillow are used for compatibility. All other platforms and Python versions use the latest pinned releases.

Entry Points

The following entry points are registered in pyproject.toml:
CommandModuleDescription
tg-ws-proxyproxy.tg_ws_proxy:mainHeadless console proxy
tg-ws-proxy-tray-winwindows:mainWindows tray application
tg-ws-proxy-tray-macosmacos:mainmacOS menubar application
tg-ws-proxy-tray-linuxlinux:mainLinux tray application

Building Standalone Executables

Release binaries are produced with PyInstaller using platform-specific spec files:
Spec fileTarget
packaging/windows.specWindows .exe
packaging/macos.specmacOS .app / DMG
packaging/linux.specLinux binary / .deb
The full build pipeline is defined in .github/workflows/build.yml and runs automatically on GitHub Actions for every tagged release. To reproduce a build locally, install PyInstaller and run the appropriate spec:
pip install pyinstaller
pyinstaller packaging/windows.spec   # or macos.spec / linux.spec
The output binary will appear in the dist/ directory.

Build docs developers (and LLMs) love