Skip to content

fix(export): preserve Hysteria2 URI semantics - #4

Merged
KnowSky404 merged 8 commits into
mainfrom
fix/hysteria2-uri-fidelity-20260828
Aug 28, 2026
Merged

KnowSky404 merged 8 commits into
mainfrom
fix/hysteria2-uri-fidelity-20260828

Conversation

@KnowSky404

Copy link
Copy Markdown
Owner

Summary

  • share one Hysteria2 URI parser between node validation and sing-box export
  • support implicit port 443, single ports, port-hopping lists/ranges, bracketed IPv6, and full userpass authentication
  • map Salamander and Gecko obfuscation without inventing Gecko packet sizes
  • fail closed for Hysteria2 certificate pinning and ECH until exact sing-box mappings exist
  • add valid/invalid fixtures, parser/export regressions, and warning-first aggregate coverage
  • update the sing-box support matrix and roadmap

Verification

The repository CI must pass the complete reusable verification chain: unit tests, Svelte/TypeScript checks, Biome, build, Cloudflare integration, Wrangler deploy dry-run, Durable Object export assertion, and Playwright.

No production deployment, Cloudflare secret mutation, or real Gist write is performed.

Share one parser between node validation and sing-box export, support default and port-hopping authorities, preserve userpass and IPv6, map Salamander and Gecko, and fail closed for unsupported certificate pinning and ECH.

Add focused fixtures, parser/export regressions, warning-first configuration coverage, and update the export matrix and roadmap.

No production deployment, Cloudflare secret mutation, or real Gist write is performed.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
subman a332f6d Aug 28 2026, 09:01 AM

Replace unsupported negated null matchers with equivalent boolean assertions so the tests remain compatible with the repository's minimal Bun matcher declarations.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e4ab15983a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/lib/proxy-protocol.ts
inferredType,
declaredType: declaredType ?? null,
syntaxValid: true,
coreFieldsValid: true,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject unsupported Hysteria2 networks during validation

For a node such as hy2://password@example.com?network=icmp, the shared parser succeeds and this branch reports coreFieldsValid: true, but parseHysteria2 rejects the same value because only tcp and udp are supported. The editor therefore accepts a node that is later dropped during export, preserving the validation/export mismatch this change is intended to eliminate; validate network in the shared parser as well.

Useful? React with 👍 / 👎.

Comment thread src/lib/hysteria2-uri.ts
if (separatorIndex < 0) {
return decodeURIComponent(rawAuth) || null;
}
if (rawAuth.indexOf(":", separatorIndex + 1) >= 0) return null;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve colons inside userpass passwords

For a valid userpass authority such as hy2://user:pa:ss@example.com, this check returns missing-auth solely because the password contains a second literal colon. Colons are permitted within URI userinfo, and the equivalent percent-encoded password is accepted, so otherwise usable links are unnecessarily skipped; split on the first delimiter and decode the complete remainder as the password.

Useful? React with 👍 / 👎.

@KnowSky404
KnowSky404 merged commit 1db3d3a into main Aug 28, 2026
2 checks passed
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