🇺🇸 English 🇨🇳 中文 🇷🇺 русский 🇮🇳 हिंदी 🇪🇸 español
A working PoC that turns an ESP32 into a $3 hardware proxy that tunnels traffic over MQTT. Because it connects out to a broker, you can bypass firewalls/censorship without open ports or public IP.
The ESP32 is the actual TCP endpoint. The Python script acts as a local proxy on the laptop. MQTT is just the pipe between them.
Tested with: Windows 10 Firefox / Python 3 <--> ESP32-S3 Dev Module <--> HiveMQ Cloud (free tier)
⚠️ The MQTT broker must be reachable from whichever country the laptop is in.
req topic.127.0.0.1:8080).CONNECT host:port line.open message over MQTT.data messages.res topic), are received by the Python proxy, and written back to Firefox.The ESP32 has limited resources and no multithreading, so it can't handle too many simultaneous connections. Trying to load pages in multiple tabs will not work.
Images and video do work, but to save bandwidth (especially on a free MQTT account) and improve speed, consider using a content blocker such as Block Image Reloaded in Firefox.
Create a free cluster at HiveMQ Cloud (or use any MQTT broker reachable from both devices).
Note the following:
8883 for TLS)Edit both files and set your MQTT credentials:
server.py
broker = "your-cluster-id.s1.eu.hivemq.cloud"
user = "your-username"
pw = "your-password"
esp.ino
const char* ssid = "your-wifi-ssid";
const char* pass = "your-wifi-password";
const char* broker = "your-cluster-id.s1.eu.hivemq.cloud";
const char* user = "your-username";
const char* mpass = "your-password";
Open esp.ino in the Arduino IDE, select your ESP32 board, and upload. Open the Serial Monitor at 115200 baud to see activity. I prefer to use PuTTY so I can copy large amounts of output.
pip install paho-mqtt
python server.py
You should see
Listening on 127.0.0.1:8080
Set Firefox HTTPS proxy to 127.0.0.1:8080
Press Ctrl+C to stop
In Firefox:
Go to Settings → General → Network Settings → Settings…
Select Manual proxy configuration
Set HTTPS Proxy to 127.0.0.1 port 8080
Make sure localhost and 127.0.0.1 are not in the "No proxy for" list
Click OK
Visit any HTTPS site. Traffic will relay through MQTT to the ESP32 and out to the real server.
| Topic | Direction | Purpose |
|---|---|---|
| req | Python → ESP32 | Client-to-server bytes (open, data, close) |
| res | ESP32 → Python | Server-to-client bytes (data) |
{
"conn_id": 5,
"host": "www.example.com",
"port": 443,
"type": "data",
"data": "FgMBB2ABAAdc..."
}
type is one of open, data, close
data is base64-encoded raw bytes, or null for open/close
conn_id identifies the TCP connection (Firefox opens several in parallel)
85 commits
C++
58.0%
Python
42.0%
🇺🇸 English 🇨🇳 中文 🇷🇺 русский 🇮🇳 हिंदी 🇪🇸 español
A working PoC that turns an ESP32 into a $3 hardware proxy that tunnels traffic over MQTT. Because it connects out to a broker, you can bypass firewalls/censorship without open ports or public IP.
The ESP32 is the actual TCP endpoint. The Python script acts as a local proxy on the laptop. MQTT is just the pipe between them.
Tested with: Windows 10 Firefox / Python 3 <--> ESP32-S3 Dev Module <--> HiveMQ Cloud (free tier)
⚠️ The MQTT broker must be reachable from whichever country the laptop is in.
req topic.127.0.0.1:8080).CONNECT host:port line.open message over MQTT.data messages.res topic), are received by the Python proxy, and written back to Firefox.The ESP32 has limited resources and no multithreading, so it can't handle too many simultaneous connections. Trying to load pages in multiple tabs will not work.
Images and video do work, but to save bandwidth (especially on a free MQTT account) and improve speed, consider using a content blocker such as Block Image Reloaded in Firefox.
Create a free cluster at HiveMQ Cloud (or use any MQTT broker reachable from both devices).
Note the following:
8883 for TLS)Edit both files and set your MQTT credentials:
server.py
broker = "your-cluster-id.s1.eu.hivemq.cloud"
user = "your-username"
pw = "your-password"
esp.ino
const char* ssid = "your-wifi-ssid";
const char* pass = "your-wifi-password";
const char* broker = "your-cluster-id.s1.eu.hivemq.cloud";
const char* user = "your-username";
const char* mpass = "your-password";
Open esp.ino in the Arduino IDE, select your ESP32 board, and upload. Open the Serial Monitor at 115200 baud to see activity. I prefer to use PuTTY so I can copy large amounts of output.
pip install paho-mqtt
python server.py
You should see
Listening on 127.0.0.1:8080
Set Firefox HTTPS proxy to 127.0.0.1:8080
Press Ctrl+C to stop
In Firefox:
Go to Settings → General → Network Settings → Settings…
Select Manual proxy configuration
Set HTTPS Proxy to 127.0.0.1 port 8080
Make sure localhost and 127.0.0.1 are not in the "No proxy for" list
Click OK
Visit any HTTPS site. Traffic will relay through MQTT to the ESP32 and out to the real server.
| Topic | Direction | Purpose |
|---|---|---|
| req | Python → ESP32 | Client-to-server bytes (open, data, close) |
| res | ESP32 → Python | Server-to-client bytes (data) |
{
"conn_id": 5,
"host": "www.example.com",
"port": 443,
"type": "data",
"data": "FgMBB2ABAAdc..."
}
type is one of open, data, close
data is base64-encoded raw bytes, or null for open/close
conn_id identifies the TCP connection (Firefox opens several in parallel)
85 commits
C++
58.0%
Python
42.0%