wa-tunnel: TCP Tunneling through Whatsapp

wa-tunnel – TCP Tunneling through Whatsapp

This is a Baileys based piece of code that lets you tunnel TCP data through two Whatsapp accounts.

This can be usable in different situations, for example, network carriers that give unlimited WhatsApp data or airplanes where you also get unlimited social network data.

It’s using Baileys since it’s a WS-based multi-device WhatsApp library and therefore could be used in android in the future, using Termux for example.

The idea is to use it with a proxy setup on the server like this: [Client (restricted access) -> Whatsapp -> Server -> Proxy -> Internet]

How does it work?

It sends TCP network packages through WhatsApp text and file messages, and depending on the amount of characters it splits them into different text messages or files.

To not get timed out by WhatsApp by default it’s limited to 20k characters per message, at the moment it’s hardcoded in wasocket.js. I have done multiple tests and anything below that may get you banned for sending too many messages and any above 80k may timeout.

If a network package is over the limit (20k chars by default) it will be sent as a file if enabled. Also if multiple network packages are cached it will use the same criteria.

File messages are sent as binary files, and TCP responses are concatenated with a delimiter and compressed using brotli to reduce data usage.

It caches TCP socket responses to group them and send the maximum amount of data in a message, therefore, reducing the amount of messages, improving the speed, and reducing the probability of getting banned.

Install & Use

Copyright (c) 2022 Aleix Mac