Information Security 18 min read

FunProxy: A Rust‑Based Cross‑Platform Full‑Link Testing and Proxy Tool

FunProxy is a Rust‑based, Tauri‑powered cross‑platform tool that provides high‑performance packet capture, cloud‑managed hosts and rules, collaborative sharing, and extensible plugins for full‑link testing and proxying across Windows, macOS, Linux, Android, iOS and web, delivering secure, low‑memory, fast startup testing.

vivo Internet Technology
vivo Internet Technology
vivo Internet Technology
FunProxy: A Rust‑Based Cross‑Platform Full‑Link Testing and Proxy Tool

In software development, full‑link testing verifies the performance, functionality, and stability of an entire system across its components, services, and modules. To simplify this process, the vivo Internet Front‑End team created FunProxy, a self‑developed, one‑stop packet‑capture and proxy tool written in Rust.

Background : The presentation illustrates a typical e‑commerce purchase flow (browsing, adding to cart, ordering, payment, delivery) and shows how each step involves different system modules (product, cart, order, payment, logistics). This highlights the complexity of configuring environments for full‑link testing, especially when multiple teams manage hosts via hosts files, custom request headers, or domain‑based configurations.

Vision & Goals : Provide a silky‑smooth, cross‑platform, high‑performance, extensible, and secure full‑link testing solution.

Technical Goals :

Cross‑platform support for Windows, macOS, Linux, Android, iOS, and web.

High performance to handle massive concurrent requests.

Easy extensibility for custom plugins and rules.

Strong security through comprehensive testing of data transmission, storage, and access control.

Technology Selection :

Rust was chosen for its system‑level capabilities, memory safety, concurrency safety, rich toolchain (rustup, cargo), and active community.

Tauri was adopted as the multi‑platform UI framework built on Rust, offering independent front‑end development, minimal binary size (~600 KB), cross‑platform compilation, high security, and seamless inter‑process communication between JavaScript front‑end and Rust back‑end.

Solution Overview : FunProxy offers the following features:

Full‑function packet capture (HTTP/1.x, HTTP/2, WebSocket, TLS 1.1‑1.3).

Cross‑platform standalone applications.

Cloud‑based hosts management (static and remote).

Cloud‑based rule sharing with wildcard and regex matching.

Collaborative capture via shareable links.

Extreme performance compared with existing capture tools (smaller install size, faster startup, lower memory usage).

Core Implementation :

FunProxy is built on the Tauri framework and consists of two core libraries: fun-core (common capabilities such as configuration and storage) and fun-mitm (Man‑in‑the‑Middle packet capture). The architecture includes a CA module for certificate handling, client and server components, HTTP and WebSocket handlers, and socket handling. Example builder code:

let mitm = Proxy::builder()
    .with_addr(addr)
    .with_client(client)
    .with_ca(ca)
    .with_http_handler(custom_handler.clone())
    .with_websocket_handler(custom_handler.clone())
    .with_graceful_shutdown(async {
        close_rx.await.unwrap_or_default();
    })
    .build();

Virtual hosts are implemented via a custom DNS resolver that first checks cloud‑host configuration, then falls back to system lookup. Example resolver code:

let resolver = tower::service_fn(move |name: Name| async move {
    let ip_option = host::get_ip(name.as_str());
    match ip_option {
        Some(ip) => {
            let ip: IpAddr = ip.parse().unwrap();
            host::add(name.as_str(), ip.to_string().as_str());
            Ok::<_, Infallible>(iter::once(SocketAddr::from((ip, 80))))
        }
        None => {
            let sys_resolver = Resolver::from_system_conf().unwrap();
            let future = spawn_blocking(move || {
                let lookup_ip = sys_resolver.lookup_ip(name.as_str()).unwrap();
                if let Some(ip) = lookup_ip.iter().next() {
                    host::add(name.as_str(), ip.to_string().as_str());
                    Ok(SocketAddr::from((ip, 80)))
                } else {
                    Err("No IP address found")
                }
            });
            let addrs = future.await.unwrap().unwrap();
            Ok::<_, Infallible>(iter::once(addrs))
        }
    }
});
let mut http_connector = HttpConnector::new_with_resolver(resolver);

Automatic certificate installation is performed via platform‑specific commands (e.g., security add‑trusted‑cert on macOS, certutil on Windows).

Traffic interception on desktop platforms uses system‑level APIs (e.g., networksetup on macOS, ProxyServer on Windows). On mobile, FunProxy leverages VPN services (VpnService) to route traffic through the proxy.

System capability examples include removing the default Tauri title bar on macOS by calling window.titlebarAppearsTransparent via a Swift bridge.

Collaborative Capture : FunProxy’s fun-core launches an API service and a WebSocket service. Shared links allow real‑time synchronization of captured packets across multiple devices.

Planning & Summary : Future work focuses on a workflow feature for full request‑response lifecycle management, enabling visual selection and conditional processing of traffic. Overall, FunProxy demonstrates how Rust and Tauri can deliver a secure, high‑performance, cross‑platform full‑link testing and proxy solution.

Cross-PlatformproxyrustTauriMITMnetwork testingfull-link testing
vivo Internet Technology
Written by

vivo Internet Technology

Sharing practical vivo Internet technology insights and salon events, plus the latest industry news and hot conferences.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.