Skip to content

fix: add Hysteria2 Salamander obfs params to Surge/Stash/Loon subscriptions#810

Open
onesyue wants to merge 1 commit intocedar2025:masterfrom
onesyue:fix/hysteria2-obfs-subscription
Open

fix: add Hysteria2 Salamander obfs params to Surge/Stash/Loon subscriptions#810
onesyue wants to merge 1 commit intocedar2025:masterfrom
onesyue:fix/hysteria2-obfs-subscription

Conversation

@onesyue
Copy link

@onesyue onesyue commented Mar 17, 2026

Summary

  • Surge, Stash, and Loon subscription handlers were missing Salamander obfuscation parameters (obfs=salamander + obfs-password) for Hysteria2
  • When obfs.open=true in protocol_settings, clients received configs without obfs params, causing protocol mismatch and connection failure
  • ClashMeta, SingBox, Shadowrocket, and General handlers already handle this correctly — only Surge/Stash/Loon were affected

Changes

  • Surge.php: Add obfs=salamander and obfs-password=xxx to hy2 config output
  • Stash.php: Add obfs and obfs-password to hy2 v2 case branch
  • Loon.php: Add obfs=salamander and obfs-password=xxx to hy2 config output

Test plan

  • Enable Salamander obfuscation on a Hysteria2 node (obfs.open: true)
  • Verify Surge subscription includes obfs=salamander,obfs-password=xxx
  • Verify Stash subscription includes obfs and obfs-password fields
  • Verify Loon subscription includes obfs=salamander,obfs-password=xxx
  • Confirm hy2 connection succeeds on all three clients after fix

🤖 Generated with Claude Code

…Surge/Stash/Loon

When Hysteria2 has Salamander obfuscation enabled (obfs.open=true),
the Surge, Stash, and Loon subscription handlers were not including
the obfs=salamander and obfs-password parameters in their output.

This caused clients to connect without obfuscation while the server
expected obfuscated traffic, resulting in protocol mismatch and
connection failure.

ClashMeta, SingBox, Shadowrocket, and General handlers already
handle this correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant