Simulation · advanced

Mobile proxy farm

Drive the rotation logic of a real Raspberry Pi and LTE-modem proxy farm: traffic-driven rotation, the keep-one-online rule, and a modem that fails to come back.

Interactive demo

Simulation. A browser model of the rotation logic in my public mobile-proxy-daemon (Go). Timings are compressed, IP addresses come from documentation ranges, and no proxy or modem is contacted.
HAProxy4 backends ready
Requests served
0
Requests failed
0
Rotations
0
Rotation queue
empty
What this shows

Rotation state machine, HAProxy runtime control, health checks, failure handling and the trade-offs behind them.

The real farm is a Raspberry Pi 4 with several Huawei USB LTE modems behind one HAProxy endpoint. Each modem gets its own subnet and Linux routing table, so every proxy instance exits through its own SIM. A Go daemon watches traffic and rotates modems to get fresh IP addresses, one at a time.

  • Traffic-driven, fair rotation. Every 3 seconds the daemon reads HAProxy's statistics. A modem whose session counter grew joins a first-in, first-out queue; idle entries time out. Only modems that were actually used get rotated.
  • One rotation at a time. A guard prevents double rotation, so the pool never loses more than one modem at once.
  • Maintenance only if another backend is online. Draining the last working modem would take the endpoint offline, for example during start-up.
  • The rotation itself: drain in HAProxy → session token → reboot through the modem's API → wait for boot → wait for LTE (status 901) → rebuild routing → regenerate the proxy config → back to ready.

The known weakness, shown honestly. In the published code, the step that returns a modem to the pool runs even when the rotation failed, so a modem without a connection can be marked ready and fail requests until the next check. Turn on the proposed fix to see the alternative: the modem stays in maintenance and is flagged for attention.

Read more: case study · build article · source code.

Related service: Infrastructure, reliability and rescue

Next step

Need this for real?

The demos run on sample data. Tell me about your source, your workflow or your data, and I will tell you what a real version would involve.