Distributed Deployment

Sometimes you may encounter this situation: your phone is at home while you are away, so how can you use it? You can use the frp or OpenVPN client built into FIRERPA to implement distributed deployment, allowing you to connect to distributed devices from any location. Both solutions require you to have a public server and configure the relevant server-side software before they can be used properly.

Danger

The operations in this chapter may expose your phone to the public network and increase security risks. Please read carefully.

In this chapter, we will not cover basic operations such as opening firewall ports. We assume that you understand these basics and have completed the required settings, and we also assume that you have some understanding of frp and OpenVPN. If you choose to deploy it yourself, we strongly recommend using OpenVPN networking.

Via the Pigeon Platform

Pigeon is an open-source management system for distributed Android devices and automated task execution. All data is fully localized, covering core scenarios such as device access, device monitoring, script development, online debugging, model configuration, and user management. It is suitable for remote device operations, batch automated execution, and AI/RPA scripts, and supports cross-network device interconnection based on P2P and FRP, as well as unified access to remote devices over local intranet interconnection. It supports managing large-scale device nodes, writing, versioning, and debugging automation scripts, dynamically delivering and executing scripts to devices, tracking task running status, results, and failure reasons, configuring AI models, supporting Prompt/hybrid script execution, managing platform users, and more.

Please visit the GitHub repository firerpa/pigeon to learn more (Pigeon requires FIRERPA 10.8 or later).

Forwarding via frp

For frp server deployment and device-side fwd.* configuration, please refer to Deploy Forwarding Service. After configuration, the forwarded port is bound to 127.0.0.1 on the frps server by default, which is suitable for accessing devices locally on the public server.

Danger

Forwarding to the public network is very dangerous. Do not be complacent, and do not assume that an IP and port are secret enough. Be sure to enable certificate verification for the service!

If you want to access devices directly from anywhere on the public network, we still do not recommend exposing ports through frp; instead, we recommend using OpenVPN to place devices and your computer on the same network segment. If you really need to expose public network ports through frp, first make sure FIRERPA uses a service certificate, and change frps proxy_bind_addr to 0.0.0.0.

Connecting to Devices Forwarded by frp

The following example demonstrates how to connect to a device on the public server where frps is deployed, assuming fwd.rport is 12345:

from lamda.client import *
d = Device("127.0.0.1", port=12345)

You can also open http://127.0.0.1:12345 or https://127.0.0.1:12345 in a browser on the server to access the device's remote desktop.

Networking via OpenVPN

Please see Deploy OpenVPN Service to learn how to connect devices to an OpenVPN network. After networking, add your personal computer to the same OpenVPN network, and you will be able to access devices directly through their private addresses. The client can be downloaded from OpenVPN Connect.