Skip to content

[Proposal] Plugin System based on WASM (wazero) for Hot-Patching Protocols & Logic on Mobile #5406

Closed

Description

@0zd0

Mobile clients (especially iOS) suffer from long App Store review cycles. When a critical bug is found in the core, or when GFW introduces new active probing that requires immediate protocol adjustments, users are left without connection for weeks until a new binary is reviewed and released.

Currently, Xray is monolithic. We cannot update internal logic without replacing the binary. On iOS, dynamic linking of native binaries is strictly forbidden by the OS sandbox.

I propose integrating a pure Go WebAssembly runtime, such as wazero, into Xray-core.

The goal is to define a set of interfaces (hooks) for:

  1. Protocol Handlers / Transports (Dialers & Listeners)
  2. Obfuscation Logic (Packet manipulation)
  3. Routing Rules

Xray should be able to load external .wasm modules at runtime (fetched from a remote URL or local storage).

How it solves the problem:

  1. Compliance: WASM is interpreted code, which is allowed by Apple's App Store guidelines (unlike native dlopen).
  2. Hot-Fixes: Developers can compile a fix (written in Go/Rust/TinyGo) to WASM and push it to clients immediately via a config update.
  3. Flexibility: We can patch specific logic flaws (for example, the recent problem [Critical] [Pending] uTLS fingerprint leakage, and how to disable uTLS #5230) without waiting for a full app release.

Alternatives considered

  • Starlark/Lua scripting: Good for routing, but too slow for heavy packet processing/crypto hooks.
  • Go Plugins: Not supported on mobile architectures and incompatible with iOS security policies.

This architecture would make Xray significantly more resilient against censorship events, allowing the community to deploy countermeasures instantly to millions of mobile users.

Activity

  1. Fangliding commented on Dec 10, 2025

    @Fangliding
    Member

    similar to #5367

  2. 0zd0 commented on Dec 10, 2025

    @0zd0
    Author

    similar to #5367

    Yes, people can compile it on Android if they need to. But for iOS users, this is not an option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions