[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-79892":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":15,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":10,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":16,"starSnapshotCount":16,"syncStatus":26,"lastSyncTime":27,"discoverSource":28},79892,"BaleTunnel","theermia\u002FBaleTunnel","theermia","BaleTunnel is a network tunneling tool that leverages the infrastructure of Bale Messenger combined with the WebRTC protocol to bypass heavy internet restrictions. ","",null,"Python",98,30,95,3,0,1,4.47,false,"main",true,[],"2026-06-12 02:03:55","# BaleTunnel\r\n\r\nBaleTunnel is a network tunneling tool that leverages the infrastructure of [Bale Messenger](https:\u002F\u002Fbale.ai) combined with the WebRTC protocol to bypass heavy internet restrictions. Network traffic is transmitted through LiveKit's encrypted DataChannel and appears as a regular voice call within the Bale platform.\r\n\r\n---\r\n\r\n## Features\r\n\r\n- Network traffic tunneling via WebRTC DataChannel\r\n- End-to-end encryption powered by LiveKit\r\n- SOCKS5 proxy for routing application traffic\r\n- Server and client operating modes\r\n- Access control system (allow-list \u002F block-list)\r\n- Configurable per-client bandwidth limits\r\n- Interactive command-line interface (CLI)\r\n- Cross-platform: Windows, Linux, and macOS\r\n- No GUI required\r\n\r\n---\r\n\r\n## Prerequisites\r\n\r\n- Python 3.10 or higher\r\n- An active Bale Messenger account\r\n\r\n---\r\n\r\n## Installation\r\n\r\n```bash\r\ncd BaleTunnel\r\npip install -r requirements.txt\r\n```\r\n\r\n---\r\n\r\n## Quick Start\r\n\r\n### Server (on a machine with unrestricted internet)\r\n\r\n```bash\r\npython src\u002Fapp.py server\r\n```\r\n\r\nThen enter the `login` command and authenticate with your phone number.\r\n\r\n### Client (on the restricted device)\r\n\r\n```bash\r\npython src\u002Fapp.py client --port 1080\r\n```\r\n\r\nAfter logging in, use `peers` to list contacts and `connect \u003Cserver_id>` to establish a tunnel to the server.\r\n\r\n---\r\n\r\n## CLI Commands\r\n\r\n| Command | Mode | Description |\r\n|---------|------|-------------|\r\n| `login` | Both | Log in with phone number |\r\n| `logout` | Both | Log out |\r\n| `status` | Both | Show connection status |\r\n| `peers` | Both | List contacts |\r\n| `connect \u003Cid>` | Client | Connect to a server |\r\n| `disconnect` | Both | Disconnect |\r\n| `pending` | Server | Show pending requests |\r\n| `accept \u003Cid> [--save]` | Server | Accept a request |\r\n| `reject \u003Cid> [--block]` | Server | Reject a request |\r\n| `clients` | Server | Show connected clients |\r\n| `kick \u003Ckey>` | Server | Disconnect a client |\r\n| `allow \u003Cuid>` | Server | Add to allow-list |\r\n| `block \u003Cuid>` | Server | Block a user |\r\n| `unblock \u003Cuid>` | Server | Unblock a user |\r\n| `admission` | Server | Show allow-list |\r\n| `blacklist` | Server | Show block-list |\r\n| `exit` | Both | Exit the application |\r\n\r\n---\r\n\r\n## Using the Proxy\r\n\r\nOnce the tunnel is established, a SOCKS5 proxy becomes available on the specified port:\r\n\r\n```bash\r\ncurl --socks5-hostname 127.0.0.1:1080 http:\u002F\u002Fifconfig.me\r\n```\r\n\r\nConfigure your browser or OS proxy settings to use SOCKS5 at `127.0.0.1:1080`. Enabling **\"Proxy DNS\"** (remote DNS resolution) is required.\r\n\r\n---\r\n\r\n## Benchmarks\r\n\r\nThe following results were obtained during real-world testing:\r\n\r\n| Parameter | Details |\r\n|-----------|---------|\r\n| **Server location** | Infomaniak, Switzerland |\r\n| **Client connection** | Iranian ADSL (Mokhaberat \u002F TCI) |\r\n| **Download speed** | 8–12 Mbps |\r\n| **Upload speed** | Not measured |\r\n| **Latency** | 120–170 ms |\r\n\r\n> **Note:** Performance depends on network conditions, server load, and ISP throttling. Results may vary.\r\n\r\n---\r\n\r\n## Project Structure\r\n\r\n```\r\nBaleTunnel\u002F\r\n├── src\u002F\r\n│   ├── app.py           # Entry point and CLI\r\n│   ├── ws_client.py     # WebSocket connection manager\r\n│   ├── relay.py         # Tunnel engine and SOCKS5 proxy\r\n│   ├── transport.py     # LiveKit transport layer\r\n│   ├── protocol.py      # Protobuf codecs\r\n│   ├── rpc.py           # gRPC-web calls\r\n│   ├── persistence.py   # Configuration storage\r\n│   ├── settings.py      # Constants and configuration\r\n│   └── ca_bundle.pem    # SSL certificate bundle\r\n├── docs\u002F\r\n│   ├── guide-fa.md      # Persian documentation\r\n│   └── guide-en.md      # English documentation\r\n├── requirements.txt\r\n├── .gitignore\r\n└── README.md\r\n```\r\n\r\n---\r\n\r\n## Technical Notes\r\n\r\n- The WebRTC connection operates independently of the WebSocket signaling channel. If the WebSocket drops temporarily, the active tunnel remains intact.\r\n- Configuration is automatically persisted in the application's working directory.\r\n- The internal SNAT system supports up to 253 concurrent client connections.\r\n- An egress filter prevents access to private and loopback addresses from the tunnel.\r\n\r\n---\r\n\r\n## Author\r\n\r\nDeveloped by **Ermia**\r\n\r\nDocumentation for this project was written with the assistance of Claude Sonnet 4.6.\r\n\r\nFor questions and suggestions:\r\n- Telegram: [@theermia](https:\u002F\u002Ft.me\u002Ftheermia)\r\n- Channel: [@thisisermia](https:\u002F\u002Ft.me\u002Fthisisermia)\r\n\r\n---\r\n\r\n## Background\r\n\r\nThis project was developed in response to the severe internet restrictions imposed in Iran. It only functions when voice calls through Bale Messenger can be established via an overseas server.\r\n\r\n*Hoping for better days for Iran.*\r\n\r\n---\r\n\r\n## License\r\n\r\nMIT License\r\n","BaleTunnel 是一款网络隧道工具，利用Bale Messenger的基础设施结合WebRTC协议来绕过严格的互联网限制。该项目通过LiveKit加密的数据通道传输网络流量，并在Bale平台上显示为普通语音通话。核心功能包括基于WebRTC数据通道的网络流量隧道、端到端加密、SOCKS5代理支持、服务器和客户端操作模式以及访问控制系统等。此外，它还提供了交互式命令行界面，支持跨平台使用（Windows、Linux和macOS）。BaleTunnel适用于需要绕过网络封锁或审查的场景，如访问被限制的网站或服务。用户需具备Python 3.10及以上版本环境及一个活跃的Bale Messenger账号以开始使用。",2,"2026-06-11 03:58:24","CREATED_QUERY"]