comparison

PCAPdroid vs. mitmproxy: Mobile Proxy Setup & SOCKS5 Routing

Compare PCAPdroid vs mitmproxy proxy setup for Android/iOS traffic inspection. Includes SOCKS5 forwarding, HTTP-to-SOCKS5 adapters, and mitmproxy alternatives.

Gideon ReedGideon Reed10 min read

TL;DR

Use PCAPdroid for non-root, per-app packet capture on Android—including raw Transmission Control Protocol (TCP), User Datagram Protocol (UDP), and Domain Name System (DNS) metadata. Use mitmproxy when you need cross-platform Android and iOS HTTP(S) inspection, request modification, and Python automation. For authorized regional Quality Assurance (QA) testing, you can chain PCAPdroid into mitmproxy via SOCKS5, or bridge mitmproxy to an external SOCKS5 gateway using a local HTTP-to-SOCKS5 adapter.

Core Summary

Capturing and inspecting all network requests from Android and iOS applications requires matching the capture layer to the protocol you need to analyze. Standard Wi-Fi HTTP proxies frequently miss traffic from mobile apps that ignore system proxy settings, communicate over custom binary protocols, or use HTTP/3 over Quick UDP Internet Connections (QUIC).

PCAPdroid solves visibility gaps on Android by creating a local Virtual Private Network (VPN) via Android’s VPNService Application Programming Interface (API), capturing every connection without root access. However, PCAPdroid is Android-only and offers limited interactive request editing. Conversely, mitmproxy provides deep HTTP and Transport Layer Security (TLS) interception across both Android and iOS, but its native upstream: mode only accepts HTTP or HTTPS upstream proxies—not SOCKS5 endpoints directly.

This guide breaks down the PCAPdroid vs mitmproxy proxy setup, provides working command-line configurations for chaining both tools, demonstrates how to deploy a local gost adapter for upstream SOCKS5 routing, and outlines the technical criteria for choosing a stable SOCKS5 endpoint for repeatable mobile QA.

PCAPdroid vs. mitmproxy: Architecture and Feature Comparison

PCAPdroid and mitmproxy operate at different layers of the network stack. PCAPdroid functions primarily as an on-device packet capture and monitoring tool, while mitmproxy is an interactive interception proxy designed for inspecting, modifying, and replaying application-layer HTTP(S) flows.

Capability PCAPdroid mitmproxy
Supported Platforms Android only Windows, macOS, Linux (inspects Android & iOS clients)
Root / Jailbreak Required No (uses Android VPNService) No for standard Wi-Fi or WireGuard capture
Primary Capture Mechanism Local VPN packet capture HTTP(S) proxy, SOCKS5 listener, WireGuard, transparent mode
Per-App Attribution Built-in Depends on capture mode (limited in standard Wi-Fi proxy)
TCP / UDP / DNS Visibility Full metadata + PCAP export Limited; primarily built for HTTP(S) flows
HTTP/3 (QUIC) Handling Captures packets; TLS decryption does not support QUIC Supported in specific modes and recent versions
HTTPS Decryption Via bundled PCAPdroid-mitm add-on Native with installed Certificate Authority (CA)
Request Modification & Replay Limited Full interactive editing and Python scripting
SOCKS5 Role Forwards TCP traffic to an external SOCKS5 server Can listen as a SOCKS5 server; upstream: is HTTP(S)-only
UDP over SOCKS5 Forwarding Not supported in external SOCKS5 integration Not provided in SOCKS5 listener mode

The two tools are complementary rather than mutually exclusive. According to the PCAPdroid official documentation, its built-in TLS decryption feature actually relies on a mitmproxy-based add-on under the hood. When testing third-party or production builds on Android 7 and later, neither tool automatically bypasses certificate pinning or Network Security Configuration rules that restrict trust to system-level CAs.

pcapdroid-official-capture-overview

When Should You Use PCAPdroid Instead of mitmproxy?

Use PCAPdroid instead of mitmproxy when you need to discover all destination IPs, DNS queries, and non-HTTP connections generated by an Android application without configuring an external desktop proxy.

Because PCAPdroid intercepts traffic at the device’s VPN layer, it captures connections from apps that ignore Android’s Wi-Fi proxy settings. Choose PCAPdroid when your workflow involves:

  • Initial network discovery: Identifying every domain, IP address, and third-party Software Development Kit (SDK) endpoint an Android app contacts in the background.
  • Non-HTTP and UDP inspection: Exporting .pcap or .pcapng files to Wireshark to inspect raw TCP handshakes, DNS lookups, or QUIC packets on UDP port 443.
  • Zero-PC field testing: Recording network behavior directly on a physical Android device while moving across cellular or Wi-Fi networks.

Choose mitmproxy when you already know the target traffic is HTTP or HTTPS and your goal is to inspect JSON payloads, test authentication headers, mock API responses, or automate traffic assertions using Python scripts.

pcapdroid-official-connection-details

Step-by-Step PCAPdroid and mitmproxy Proxy Setup (Android)

Chaining PCAPdroid into a desktop mitmproxy instance gives QA engineers the best of both worlds on Android: per-app traffic routing via PCAPdroid’s VPN layer and deep HTTP(S) inspection in mitmproxy.

1. Start mitmproxy as a SOCKS5 Listener

On your workstation, launch mitmproxy (or mitmweb for a browser UI) in SOCKS5 mode so it can accept forwarded TCP connections from PCAPdroid:

bashbash
mitmweb \
  --mode socks5 \
  --listen-host 0.0.0.0 \
  --listen-port 8050

Restrict port 8050 to your local test subnet via your host firewall. Never expose an unauthenticated proxy listener to the public internet.

2. Configure SOCKS5 Redirection in PCAPdroid

On your Android test device connected to the same local network:

  1. Open PCAPdroid and navigate to Settings > SOCKS5 Proxy.
  2. Toggle SOCKS5 redirection on.
  3. Set Proxy host to your workstation’s local IP address (for example, 192.168.1.100).
  4. Set Proxy port to 8050.
  5. Use the App filter on the main screen to isolate your target QA application, then tap Ready to start capturing.

3. Install the CA Certificate and Verify Connectivity

To inspect decrypted HTTPS payloads on authorized debug builds, transfer ~/.mitmproxy/mitmproxy-ca-cert.cer to the Android device and install it under Android’s CA certificate settings.

Before launching the app, verify that your mitmproxy SOCKS5 listener is reachable from another terminal using curl:

bashbash
curl --proxy socks5h://192.168.1.100:8050 https://example.com/

Using the socks5h:// scheme forces hostname resolution through the proxy rather than the local client. If the connection fails or times out, check your local firewall rules or review common causes in our proxy connection failed troubleshooting guide.

mitmproxy-ca-certificate-installation

How to Route mitmproxy Through an Upstream SOCKS5 Proxy

In multi-region QA workflows, engineers often need to inspect mobile traffic in mitmproxy while routing the outbound exit connection through a regional SOCKS5 gateway.

A common configuration mistake is attempting to pass a socks5:// URL directly into mitmproxy’s native upstream mode:

bashbash
# This fails: mitmproxy upstream mode only accepts http:// or https://
mitmproxy --mode upstream:socks5://username:password@proxy.example.com:1080

As detailed in the mitmproxy proxy modes documentation, the upstream: specification only supports HTTP and HTTPS upstream servers. To connect mitmproxy to a SOCKS5 provider, insert a lightweight local HTTP-to-SOCKS5 adapter such as gost between mitmproxy and your SOCKS5 endpoint.

mitmproxy-upstream-http-https-support

Topology

Mobile Test Device → mitmproxy (Port 8080) → Local gost Adapter (HTTP Port 8888) → External SOCKS5 Gateway → Staging Backend

Working Setup with gost

  1. Start a local gost listener that accepts HTTP proxy requests on port 8888 and forwards them to your authenticated SOCKS5 endpoint (replace the placeholders with your actual credentials):
bashbash
gost -L http://127.0.0.1:8888 -F socks5://YOUR_USERNAME:YOUR_PASSWORD@YOUR_SOCKS5_HOST:PORT
  1. Launch mitmproxy pointing its upstream: mode to the local gost HTTP port:
bashbash
mitmweb \
  --listen-host 0.0.0.0 \
  --listen-port 8080 \
  --mode upstream:http://127.0.0.1:8888
  1. Point your Android or iOS device’s Wi-Fi HTTP proxy to your workstation IP on port 8080. All captured HTTP(S) traffic now passes through mitmproxy for inspection before exiting through your remote SOCKS5 endpoint.

Option 2: Persistent Setup with Privoxy

If you prefer a persistent background service managed by systemd rather than running a foreground CLI command, you can use Privoxy as your local HTTP-to-SOCKS5 bridge.

  1. Install Privoxy on Ubuntu/Debian (or via Homebrew on macOS):
bashbash
sudo apt update && sudo apt install privoxy
  1. Open /etc/privoxy/config and add a local listen address alongside a forward-socks5 rule pointing to your SOCKS5 endpoint (include the trailing dot . to indicate no secondary HTTP parent proxy):
iniini
listen-address  127.0.0.1:8118
forward-socks5  /  YOUR_USERNAME:YOUR_PASSWORD@YOUR_SOCKS5_HOST:PORT .

Using forward-socks5 (instead of forward-socks5t) sends hostname resolution through the remote SOCKS5 server, preventing local DNS leaks during regional QA tests. Restrict file permissions on /etc/privoxy/config (chmod 600) whenever it stores proxy credentials.

  1. Restart Privoxy and point mitmproxy’s upstream mode to port 8118:
bashbash
sudo systemctl restart privoxy

mitmweb \
  --listen-host 0.0.0.0 \
  --listen-port 8080 \
  --mode upstream:http://127.0.0.1:8118
  1. Verify the chain independently before connecting your mobile device:
bashbash
curl -x http://127.0.0.1:8118 https://ifconfig.me

gost vs. Privoxy: Which Local Adapter Fits Your Workflow?

Adapter Best For Setup Overhead Key Trade-off
gost Quick, ad-hoc QA sessions and disposable test environments Single CLI command; no config file required Runs as a foreground process unless wrapped in a service
Privoxy Persistent Linux/macOS QA gateways and shared lab machines Requires editing /etc/privoxy/config and restarting the daemon Extra config management, but integrates natively with systemd

Capturing iOS Traffic and Top mitmproxy Alternatives

Because PCAPdroid relies on Android’s VPNService API, it cannot run on iOS. To capture network requests on iOS without jailbreaking, configure a manual Wi-Fi HTTP proxy pointing to your desktop tool, use mitmproxy’s WireGuard capture mode (mitmweb --mode wireguard), or route the iPhone through a Mac’s shared network interface for Wireshark packet capture.

If your team prefers a dedicated graphical interface or native mobile companion apps over command-line scripting, evaluate these established mitmproxy alternative android ios tools:

Tool Platforms Open Source Key Strength for Mobile QA
Proxyman macOS, Windows, Linux, iOS No Native iOS app for on-device capture, clean UI, GraphQL/WebSocket support
HTTP Toolkit Windows, macOS, Linux, Android Yes Automated Android emulator and ADB interception setup
Charles Proxy Windows, macOS, Linux, iOS No Mature bandwidth throttling, SSL proxying, and dedicated iOS companion app
Burp Suite Windows, macOS, Linux No Authorized mobile API security testing, Repeater, and extension ecosystem

Selecting a SOCKS5 Proxy for Authorized Mobile QA

When routing mobile QA traffic through an external gateway, proxy stability directly impacts test reproducibility. Frequently rotating IP pools complicate session debugging and make it harder to correlate client requests with server-side logs.

Evaluate any SOCKS5 endpoint against these technical requirements before integrating it into your mobile test lab:

  • RFC 1928 and RFC 1929 compliance: Standard SOCKS5 protocol support with username/password authentication.
  • TCP CONNECT support: Essential for forwarding HTTP, HTTPS, and raw TCP streams from PCAPdroid or local adapters.
  • Remote DNS resolution: Ensures hostnames resolve at the regional gateway rather than leaking local test network DNS queries. For verification steps, see our guide on how to fix a DNS leak.
  • Static or session-persistent exit IP: Prevents mid-session IP changes during multi-step checkout, login, or regional staging tests. Understanding static vs rotating proxies helps you avoid unintended session resets.

For repeatable API debugging and controlled staging verification, Socks5.IO provides static datacenter proxies that deliver fixed exit IPs and predictable latency. When your QA plan specifically requires validating how an application behaves on consumer Internet Service Provider (ISP) networks, static residential proxies offer fixed ISP-assigned addresses without mid-test rotation. You can review credential formatting and port configuration in the static datacenter proxy getting started guide.

Keep two protocol boundaries in mind during setup:

  1. No built-in encryption: The SOCKS5 protocol negotiates connections but does not encrypt application payloads by itself. Always rely on TLS/HTTPS for sensitive test data, and review SOCKS vs HTTP Proxy when deciding which protocol fits your local adapter.
  2. UDP forwarding limits: Even if a SOCKS5 server supports UDP ASSOCIATE, PCAPdroid’s external SOCKS5 redirection currently forwards TCP traffic only. Inspect UDP and QUIC streams separately using local PCAP exports and Wireshark.

Conclusion

For a PCAPdroid vs mitmproxy proxy setup, choose the tool by the traffic you need to see: PCAPdroid provides Android packet visibility and app attribution, while mitmproxy supports interactive HTTP(S) inspection, request editing, and automation for Android and iOS clients.

Use the following sequence to build a repeatable test setup:

  1. Discover the traffic. Use PCAPdroid on Android to identify destinations and distinguish TCP connections from UDP or QUIC traffic.
  2. Add HTTP(S) inspection. Forward PCAPdroid’s TCP connections to mitmproxy’s SOCKS5 listener, or configure an iOS HTTP proxy or WireGuard capture path. Check CA trust before inspecting HTTPS payloads.
  3. Configure the regional exit separately. When mitmproxy must route through a SOCKS5 gateway, place a local HTTP-to-SOCKS5 adapter between them; do not pass a SOCKS5 URL to native upstream: mode.
  4. Verify the complete route. Confirm that the intended request appears in mitmproxy, reaches the expected backend, and uses the expected exit IP. Check DNS behavior and UDP traffic separately rather than treating one successful HTTPS request as proof of complete coverage.

For regional tests that need a consistent exit, choose a static SOCKS5 endpoint and keep the capture method, certificate configuration, and routing parameters consistent between runs. The right proxy supports reproducible testing; packet capture and HTTP inspection establish what actually happened.

FAQs

Yes, PCAPdroid can capture encrypted HTTPS packets without root, but decrypting the payloads requires specific app and certificate conditions. Using Android’s local VPNService, PCAPdroid logs destination IPs, domains, and TLS metadata for any app. To read decrypted HTTP bodies, you must enable its PCAPdroid-mitm add-on and install the CA certificate. On Android 7+, third-party apps that enforce certificate pinning or ignore user-installed CAs will still reject decryption without a debug build or root access.

Latest articles

Global proxy network illustration

Plug into the global proxy network — every connection faster and more stable

Start for Free