Skip to content

Hysteria2: support Gecko obfuscation from apernet/hysteria v2.9.2 #4171

Description

@luvkult

apernet/hysteria added Gecko obfuscation in v2.9.2. It fragments QUIC long-header packets into 2-8 random-sized chunks with random padding, then sends each fragment through a Salamander wrap. Short-header packets pass through plain Salamander. Spec is in PROTOCOL.md, config keys are obfs.type: gecko + gecko.password / minPacketSize / maxPacketSize.

sing-box currently accepts only obfs.type: salamander for hysteria2. Subscription URIs carrying ?obfs=gecko&obfs-password=... are silently dropped from imported profiles (Karing 1.2.19.2208 on Android, kernel sing-box 1.13.x — entry vanishes with no parse error in core log).

Repro

  1. Server: apernet/hysteria v2.9.2, obfs.type: gecko, password X.
  2. Client URI: hysteria2://pw@host:443/?sni=host&alpn=h3&obfs=gecko&obfs-password=X#NL.
  3. Import via subscription. Profile list shows no NL entry; no error surfaced to the user.

Expected

Either parse obfs=gecko and apply the Gecko transform on the QUIC layer, or surface an explicit "unsupported obfs type" error so it doesn't disappear silently.

Refs

Use case

Salamander wraps QUIC into random UDP, but Initial packet sizes still cluster around 1200 bytes which is observable to statistical DPI. Gecko randomises that distribution.

Happy to test a patch on a real chain (3 nodes, ~200 active clients).

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