Skip to content

TLS ECH: Update ECH configuration parsing logic to be more robust#6441

Merged
RPRX merged 3 commits into
XTLS:mainfrom
jamesliu96:main
Jul 8, 2026
Merged

TLS ECH: Update ECH configuration parsing logic to be more robust#6441
RPRX merged 3 commits into
XTLS:mainfrom
jamesliu96:main

Conversation

@jamesliu96

@jamesliu96 jamesliu96 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Key Changes: Robust Configuration String Splitting

  1. Swapped out aggressive, un-delimited splitting in favor of strings.SplitN(c.EchConfigList, "+", 2).
    This ensures that if the downstream DoH or h2c URL contains query parameters or search paths that inherently use the plus sign (+) (e.g., https://some-dns.com/dns-query?token=123+xyz), it will no longer be erroneously truncated.

  2. IPv6 and port detection support. Improved the port-appending mechanism for fallback classic UDP servers using standard library net.SplitHostPort.
    The previous strings.Contains(udpServerAddr, ":") check was fundamentally flawed when users inputted explicit IPv6 formats like udp://[2001:db8::1], bypassing the default :53 port injection.

jamesliu96 and others added 3 commits July 7, 2026 15:21
@RPRX RPRX requested a review from Fangliding July 7, 2026 12:08
@RPRX

RPRX commented Jul 7, 2026

Copy link
Copy Markdown
Member

@Fangliding ready 时说一声

@Fangliding

Copy link
Copy Markdown
Member

就这样吧

@RPRX RPRX merged commit e4e7614 into XTLS:main Jul 8, 2026
40 checks passed
@RPRX

RPRX commented Jul 8, 2026

Copy link
Copy Markdown
Member

@jamesliu96 顺便说一下你这个 commit 邮箱挺怪的,是 jamesliu96@users.noreply.github.com,前面少了 2211002+

@jamesliu96

Copy link
Copy Markdown
Contributor Author

@RPRX Thanks for the heads-up! According to GitHub's documentation (see GitHub Docs), accounts created before July 18, 2017 use the USERNAME@users.noreply.github.com format without the ID prefix. That's why it looks a bit different.

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.

3 participants