Skip to content

feat: add Hysteria2 protocol support and bump xray-core to v1.260327.0#140

Open
belaytzev wants to merge 2 commits intokutovoys:mainfrom
belaytzev:support-xray-core-26.3.27-
Open

feat: add Hysteria2 protocol support and bump xray-core to v1.260327.0#140
belaytzev wants to merge 2 commits intokutovoys:mainfrom
belaytzev:support-xray-core-26.3.27-

Conversation

@belaytzev
Copy link
Copy Markdown

@belaytzev belaytzev commented Mar 31, 2026

Summary

  • Add full Hysteria2 protocol support (parsing, config generation, validation)
  • Bump xray-core from v1.251208.0 to v1.260327.0
  • Bump Go from 1.25 to 1.26
  • Update libxray to upstream with merged QuicParams migration (XTLS/libXray#114)

Changes

Hysteria2 Protocol (models/proxy_config.go)

  • Add 7 hysteria-specific fields: HysteriaAuth, HysteriaUp, HysteriaDown, HysteriaPorts, HysteriaHopInterval, HysteriaObfs, HysteriaObfsPassword
  • Add validation, stable ID generation, and debug output for hysteria protocol

Parser (subscription/parser.go)

  • Add struct types for hysteria stream settings (libXrayHysteriaSettings, libXrayFinalMask, libXrayQuicParams, libXrayUdpHop, libXrayMask, libXraySalamander)
  • Parse hysteria outbound in both flat and standard settings formats
  • Extract QuicParams (bandwidth, port-hopping) and Salamander obfuscation from FinalMask
  • Add hysteria2:// and hy2:// to base64 decode skip list
  • Add debug logging for FinalMask parse failures

Config Generator (xray/config.go)

  • Generate hysteria outbound settings (address, port, version, auth)
  • Generate hysteria stream settings with hysteriaSettings, QuicParams (congestion, bandwidth, UDP hop), and Salamander via sockopt.finalMask
  • Default network to hysteria and security to tls for hysteria protocol
  • Remove wasteful empty sockopt: {} from non-hysteria stream settings

Dependencies

Test plan

  • Builds successfully (go build ./...)
  • Tested with real subscription containing both VLESS/xhttp and Hysteria2 proxies
  • Hysteria2 proxy connects and routes traffic correctly (verified different exit IP)
  • VLESS/xhttp proxy continues to work as before
  • Uses upstream libxray (no fork replace directive)

🤖 Generated with Claude Code

belaytzev and others added 2 commits March 31, 2026 23:18
- Add Hysteria2 protocol to model, parser, and config generator
- Parse hysteria outbound settings (auth, bandwidth, port-hopping, salamander obfs)
- Extract QuicParams and FinalMask from stream settings
- Generate proper xray-core config with hysteriaSettings and sockopt.finalMask
- Default network to "hysteria" and security to "tls" for hysteria protocol
- Update libxray to fork with QuicParams migration (XTLS/libXray#114)
- Bump xray-core to v1.260327.0, Go to 1.26
- Add hy2:// and hysteria2:// to base64 decode skip list
- Add debug logging for FinalMask parse failures
- Remove empty sockopt from non-hysteria stream settings

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove fork replace directive and point to upstream commit 0e9dc945
(merged QuicParams migration).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@belaytzev belaytzev marked this pull request as ready for review April 1, 2026 07:35
@belaytzev
Copy link
Copy Markdown
Author

#139

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