Cesar Petrescu

Lab · Infrastructure

  • Production
  • Mobile Edge Systems

Pocket Suite

Two no-root Android edge systems: selectable Internet egress and supervised self-hosting

PocketExit and PocketHost are separate public projects built around the same constraint: ordinary Android devices should become useful edge infrastructure without root, ADB, a custom ROM, or an inbound phone listener. PocketExit turns owned phones into selectable Wi-Fi or cellular SOCKS5 exits; PocketHost turns a phone or tablet into a supervised personal server running packaged Go daemons.

Status: PocketExit public release · PocketHost developer MVP

  • Android
  • Kotlin
  • Jetpack Compose
  • Go
  • SOCKS5
  • WebSocket
  • Nginx
  • Cloudflare Tunnel
  • SQLite

Two public Android edge projects · separate products, shared constraints

One phone can become an Internet exit or a supervised personal server

Select PocketExit or PocketHost to trace the relevant control, network, runtime, and evidence path. The suite groups the projects without claiming that they share one backend, credential store, or runtime.

Traffic exits through the exact owned phone and Android network requested

The authenticated gateway parses the requested phone and radio, chooses only an eligible fresh node, creates a bounded circuit, and waits for the Android agent to establish the destination socket. DNS and the socket are bound to the selected Android Network, so cellular-only means the SIM or a clear failure—not silent Wi-Fi fallback.

Ordinary APIs
No root, ADB dependency, custom ROM, device-owner mode, inbound phone listener, or VpnService.
Independent policies
Control transport and destination egress can use different validated Wi-Fi or cellular Network handles.
Fail closed
An unavailable requested radio fails the circuit instead of leaking traffic through another route.
Destination ACL
Loopback, private, CGNAT, link-local, metadata, multicast, and other unsafe ranges are rejected.
  • Authenticated admissionSOCKS5 client → Nginx edge → Go gateway → Gateway registry
  • Selected phoneGo gateway → Android exit agent
  • Wi-Fi egressAndroid exit agent → Wi-Fi Network
  • Cellular egressAndroid exit agent → Cellular / SIM
  • Owner configurationDevice owner → Android exit agent

The Android app supervises native services instead of relying on shell scripts

The Compose UI and foreground service validate configuration, launch packaged Go daemons, collect and redact output, poll health endpoints, persist bounded diagnostics, and expose services only through an owner-approved LAN or tunnel path.

Control/data split
Kotlin owns Android lifecycle and supervision; Go daemons own HTTP, files, reverse proxying, DDNS, and optional services.
Loopback first
Services bind to 127.0.0.1 unless both the application setting and daemon-side public-bind gate are enabled.
Supervised lifecycle
A foreground service starts, stops, restarts, probes, and reports each daemon.
Evidence
Logs are redacted before bounded SQLite persistence and diagnostics export.
  • Owner controlDevice owner → Android control plane → Process supervisor
  • Daemon lifecycleProcess supervisor → Native Go daemons
  • Health and logsProcess supervisor → App-private state
  • Private LAN accessLAN / tunnel client → Native Go daemons
  • Deliberate tunnel accessLAN / tunnel client → Private / Cloudflare tunnel → Native Go daemons
  • User / control request
  • Android or server runtime
  • State / evidence
Clients and ownersClients and ownersPocketExitPocketExitPocketHostPocketHostNetworks and ingressNetworks and ingressDevice ownerconfigure + approveDevice owner — configure + approveSOCKS5 clientselect phone + radioSOCKS5 client — select phone + radioLAN / tunnel clientconsume hosted serviceLAN / tunnel client — consume hosted serviceNginx edgeTLS + SOCKS streamNginx edge — TLS + SOCKS streamGo gatewayauth + circuits + schedulingGo gateway — auth + circuits + schedulingAndroid exit agentKotlin + public APIsAndroid exit agent — Kotlin + public APIsGateway registrynodes + health + circuitsGateway registry — nodes + health + circuitsAndroid control planeCompose + foreground serviceAndroid control plane — Compose + foreground serviceProcess supervisorhealth + logs + lifecycleProcess supervisor — health + logs + lifecycleNative Go daemonsweb + files + proxyNative Go daemons — web + files + proxyApp-private stateconfig + SQLite logsApp-private state — config + SQLite logsWi-Fi Networkvalidated Android NetworkWi-Fi Network — validated Android NetworkCellular / SIMvalidated Android NetworkCellular / SIM — validated Android NetworkPrivate / Cloudflare tunnelexplicit public pathPrivate / Cloudflare tunnel — explicit public path

Tap a service to see what it calls and what calls it.

Clients and owners

PocketExit

PocketHost

Networks and ingress

PRODUCT BOUNDARY

Two products remain two products

Pocket Suite is a portfolio family, not a shared production control plane.

ANDROID BOUNDARY

Ordinary APIs only

Neither project depends on root, ADB, a custom ROM, or permanent inbound device access.

NETWORK POLICY

Requested routes do not silently degrade

PocketExit fails unavailable radio policies; PocketHost remains loopback-only until exposure is approved.

EXPOSURE RULE

Public ingress is deliberate

Devices dial outward for control or tunneling instead of exposing raw mobile-network listeners.

EVIDENCE

Runtime truth is observable

Circuit eligibility, daemon health, redacted logs, and validation artifacts remain visible.

Why it exists

Phones already contain useful compute, storage, Wi-Fi, and cellular radios. The suite explores how far those resources can be used while staying inside supported Android application boundaries.

The two projects demonstrate opposite edge directions: traffic can leave through a selected phone and SIM, while applications and files can be served from a supervised phone or tablet.

Use cases

  • Select a specific owned phone and SIM as SOCKS5 egress
  • Keep control on Wi-Fi while forcing destination traffic through cellular
  • Repurpose a spare phone as a local web/file/proxy node
  • Publish selected local services through an explicit tunnel

Capabilities

Selectable egress
choose phone and radio per connection.
No-root operation
public Android APIs only.
Supervised services
lifecycle, health, logs, and diagnostics.
Fail-closed policy
unavailable radios, unsafe destinations, and unapproved exposure produce visible failure.
Public evidence
source, releases, architecture, protocol, and documented MVP limits.

Components

PocketExit — selectable egress

  • Authenticated SOCKS5 gateway
  • Per-request phone and radio selection
  • Kotlin agent with Network-bound DNS and sockets
  • Public source, CI, releases, protocol docs, and threat model

PocketHost — supervised Android server

  • Compose dashboard and foreground supervisor
  • Packaged Go daemons for web, files, proxying, and DDNS
  • Loopback-first access with explicit LAN/tunnel gates
  • Health checks, redacted logs, and diagnostics export

Honest delivery status

  • PocketExit is the released externally inspectable flagship
  • PocketHost is a developer-sideload MVP
  • PocketHost signing, public distribution, device CI, and optional-service validation remain follow-up work

Integrations

PocketExit

  • github.com/CesarPetrescu/PocketExit
  • exit.photonspark.ro
  • Go gateway, Kotlin agent, Nginx, SOCKS5, and authenticated circuit WebSockets

PocketHost

  • github.com/CesarPetrescu/PocketHost
  • Kotlin/Compose control plane and cross-compiled Go daemons
  • Owner-configured Cloudflare DNS/tunnel integrations

Outcome

PocketExit provides the public-release proof for selectable cellular egress; PocketHost provides the supervised self-hosting MVP. Both keep policy, failure, and runtime evidence explicit while staying inside ordinary Android application boundaries.