How danieldev23/trafexia works
1. Overall shape
- Trafexia is a desktop application built on Electron + Vue 3 + TypeScript.
- It has a clear split between:
- Electron main process for privileged system work and networking
- Preload layer for controlled IPC exposure
- Vue renderer for the UI and user-driven workflows
2. Core runtime boundary
- The main process owns the sensitive capabilities: proxying, certificate generation/installation, traffic capture, storage, Frida orchestration, APK patching, and local device integration.
- The renderer is mostly a control/visualization layer. It shows traffic, rules, device status, bypass controls, and export tools.
- Communication between them is through IPC handlers defined in electron/main/ipc-handlers.ts and exposed through electron/preload/index.ts.
3. Traffic interception pipeline
- The center of the product is a local MITM proxy implemented in main-process services.
- Incoming mobile-device traffic flows through:
- ProxyServer for interception
- CertServer / CertificateManager for CA certificate distribution and trust setup
- TrafficStorage for persistence
- RequestComposer and downstream rule services for replay/manipulation
- This is the main data path from external devices into the app’s UI and database.
4. Traffic transformation and response control
- Several services modify requests before they reach the destination:
- MapService for URL rewriting / routing
- MockService for returning synthetic responses
- ThrottleService for latency/bandwidth shaping
- BreakpointService for pausing and editing flows
- These act as policy layers around the proxy, so the architecture is not just capture-only; it actively rewrites and simulates traffic.
5. Persistent storage and session history
- Captured requests and session data are stored locally using Better-SQLite3.
- The trafficStore in the renderer reads from that stored history for filtering, timelines, request detail views, and comparisons.
- This makes the app stateful across sessions rather than a pure live monitor.
6. Certificate and trust infrastructure
- The app generates and manages a local CA certificate for HTTPS interception.
- CertificateManager and CertServer support certificate creation and delivery to devices.
- This subsystem is a prerequisite for the MITM proxy and is tightly coupled to the mobile setup experience in the UI.
7. SSL pinning bypass subsystem
- The electron/ssl-bypass area is a distinct subsystem for bypassing app-level certificate checks.
- It supports two main strategies:
- APK patching via ApkSignerService and apk-patcher.ts
- Frida-based runtime injection via FridaManager, frida-injector.ts, and helper scripts under electron/scripts
- This subsystem sits alongside the proxy rather than inside it, because it targets the mobile app/device behavior, not the desktop proxy itself.
8. Android and iOS device integration
- AndroidService and IosService handle platform-specific setup and workflows.
- Android support is broader: APK patching, Frida injection, certificate setup, and device/app selection.
- iOS support is more focused on proxy/certificate setup, with the UI providing bridge dialogs and instructions.
- These are external-device-facing boundaries, not just app-internal modules.
9. Renderer UI structure
- The Vue app is organized around functional panels rather than a generic SPA layout:
- traffic list/detail/timeline
- proxy controls
- mock/map/throttle/breakpoint editors
- Frida panel
- SSL bypass view
- settings and license dialogs
- State is centralized in Pinia stores such as proxyStore, trafficStore, fridaStore, sslBypassStore, settingsStore, and licenseStore.
10. Licensing and feature gating
- There is a dedicated LicenseService in the main process and a corresponding licenseStore in the renderer.
- src/utils/featureLock.ts suggests some capabilities are gated behind licensing or activation state.
- This means the architecture includes both functional services and entitlement checks.
11. Export and analysis utilities
- The renderer includes request-centric utilities for:
- formatting and highlighting
- diffing requests/responses
- exporting to HAR, cURL, Python, and Postman
- These are UI-side analysis tools built on top of traffic data from the main process and are important for understanding how captured data leaves the system.
12. Supporting code and shared contracts
- shared/types.ts provides cross-process type definitions, which is important because Electron apps need stable contracts between main, preload, and renderer.
- The presence of shared types indicates a deliberate boundary to avoid ad hoc IPC payloads.
13. Ancillary static surfaces
- The repo also contains a separate landing-page folder and a top-level index.html, which appear to support marketing or product presentation rather than core runtime behavior.
- These are not part of the interception pipeline and should be treated as auxiliary, web-static assets.
14. Build and release path
- The project is packaged with electron-builder and built through Vite.
- GitHub Actions (.github/workflows/release.yml) automates multi-platform releases for macOS, Windows, and Linux.
- That release pipeline is operationally important because this is a desktop tool distributed as native installers, not a server-deployed app.
Main entry points: index.ts Preload API · App.vue Vue app · MapRulesManager.vue Rules editors · RequestComposer.ts Composer
Components 34
Electron main
Privileged runtime for proxying, capture, device integration, and local services.
- Main entry · Starts the Electron main process and wires core services.
electron/main/index.ts - Proxy server · Intercepts device traffic and anchors the capture pipeline.
electron/main/services/ProxyServer.ts - Certificate mgr · Generates and manages the local CA used for HTTPS interception.
electron/main/services/CertificateManager.ts - Cert server · Serves certificates and trust artifacts to connected devices.
electron/main/services/CertServer.ts - Traffic store · Persists captured sessions, requests, and history locally.
electron/main/services/TrafficStorage.ts - Composer · Builds modified or replayed requests from captured traffic.
electron/main/services/RequestComposer.ts - Map rules · Rewrites URLs and routes traffic according to mapping rules.
electron/main/services/MapService.ts - Mock rules · Returns fabricated responses instead of forwarding requests.
electron/main/services/MockService.ts - Throttle · Applies latency and bandwidth controls to traffic.
electron/main/services/ThrottleService.ts - Breakpoint · Stops flows for inspection and manual editing.
electron/main/services/BreakpointService.ts - Android service · Coordinates Android-specific setup, device workflows, and tooling.
electron/main/services/AndroidService.ts - iOS service · Handles iOS proxy and certificate setup workflows.
electron/main/services/IosService.ts - Frida mgr · Orchestrates Frida-based app instrumentation.
electron/main/services/FridaManager.ts - APK signer · Signs patched Android packages after modification.
electron/main/services/ApkSignerService.ts - License service · Validates feature access and activation state.
electron/main/services/LicenseService.ts
IPC bridge
Controlled boundary between main and renderer.
- IPC handlers · Registers main-process commands exposed to the renderer.
electron/main/ipc-handlers.ts - Preload API · Exposes a constrained IPC surface to the Vue app.
electron/preload/index.ts
Vue renderer
UI, analysis tools, and user workflows.
- Vue app · Top-level renderer shell for the desktop UI.
src/App.vue - Traffic store · Reads captured traffic and drives filtering and comparison views.
src/stores/trafficStore.ts - Proxy store · Tracks proxy status and control state.
src/stores/proxyStore.ts - Frida store · Tracks Frida session state and device hooks.
src/stores/fridaStore.ts - Bypass store · Tracks SSL-bypass mode, targets, and progress.
src/stores/sslBypassStore.ts - License store · Holds activation and feature-gate state.
src/stores/licenseStore.ts - Proxy control · Starts, stops, and configures interception.
src/components/ProxyControl.vue - Request views · Traffic list, detail, timeline, diff, and composer views.
src/components/RequestList.vue - Rules editors · Editors for mock, map, throttle, and breakpoint rules.
src/components/MapRulesManager.vue - Device panels · Android and iOS bridge dialogs plus setup guidance.
src/components/AndroidBridgeDialog.vue - Bypass view · Controls SSL-bypass workflows and displays results.
src/components/SslBypassView.vue - License dialog · Handles activation and licensing prompts.
src/components/LicenseDialog.vue - Export tools · Exports captured traffic to HAR, cURL, Python, and Postman.
src/utils/postmanExport.ts - Feature lock · UI-side checks for gated capabilities.
src/utils/featureLock.ts
SSL bypass
Android app trust-bypass strategies and scripts.
- Bypass IPC · IPC surface for SSL-bypass actions and status.
electron/ssl-bypass/ssl-bypass-ipc.ts - APK patcher · Applies certificate-unpinning patches to Android APKs.
electron/ssl-bypass/apk-patcher.ts - Frida injector · Launches Frida-based bypass scripts and payloads.
electron/ssl-bypass/frida-injector.ts
Connections 40
- Main entry → IPC handlers: registers · Bootstraps main-process command handlers.
- IPC handlers → Preload API: exposes · IPC contract surfaced to the renderer.
- Proxy control → Preload API: calls · UI uses bridged commands for proxy control.
- Request views → Preload API: reads · Renderer queries traffic and request details.
- Rules editors → Preload API: updates · Renderer pushes rule changes through IPC.
- Device panels → Preload API: configures · Setup and device actions are sent to main.
- Bypass view → Preload API: triggers · Bypass actions flow through the bridge.
- License dialog → Preload API: activates · License actions are routed to main.
- Proxy server → Certificate mgr: uses · Proxy depends on local CA generation and trust.
- Proxy server → Cert server: serves · Proxy setup relies on certificate delivery.
- Proxy server → Traffic store: persists · Captured traffic is stored locally.
- Proxy server → Composer: replays · Captured flows can be composed and replayed.
- Composer → Map rules: applies · Composed requests may be rewritten or rerouted.
- Composer → Mock rules: applies · Composed requests may be mocked.
- Composer → Throttle: applies · Composed traffic may be delayed or shaped.
- Composer → Breakpoint: applies · Flows may be paused for editing.
- Android service → Frida mgr: orchestrates · Android workflows can launch Frida instrumentation.
- Android service → APK signer: packages · Patched APKs are signed for deployment.
- Android service → Bypass IPC: invokes · Bypass features are coordinated through IPC.
- Bypass IPC → APK patcher: runs · APK patching strategy is selected here.
- Bypass IPC → Frida injector: runs · Frida strategy is selected here.
- Vue app → Proxy store: binds · UI reflects proxy state from Pinia.
- Vue app → Traffic store: binds · UI reflects captured traffic state.
- Vue app → Frida store: binds · UI reflects Frida state.
- Vue app → Bypass store: binds · UI reflects bypass state.
- Vue app → License store: binds · UI reflects entitlement state.
- Traffic store → Traffic store: loads · Renderer reads persisted sessions for analysis.
- Proxy control → Proxy store: controls · Proxy UI drives local state.
- Request views → Traffic store: analyzes · Lists, details, timelines, and diffs come from stored traffic.
- Rules editors → Map rules: edits · Mapping rules configure request rewrites.
- Rules editors → Mock rules: edits · Mock rules configure synthetic responses.
- Rules editors → Throttle: edits · Throttle settings shape traffic behavior.
- Rules editors → Breakpoint: edits · Breakpoint settings control pausing behavior.
- Device panels → Android service: drives · Android setup and selection flows.
- Device panels → iOS service: drives · iOS setup and instructions.
- Bypass view → Bypass store: shows · Bypass UI reflects state and progress.
- Bypass view → Frida store: shows · Bypass UI shows Frida instrumentation status.
- License dialog → License store: shows · License UI reflects activation state.
- Feature lock → License store: checks · Capabilities are gated by entitlement state.
- Export tools → Traffic store: exports · Captured traffic can be exported to common formats.