fix: xray converter and HTTP DSL runtime parity#33
Open
wuchulonly wants to merge 21 commits into
Open
Conversation
对齐 xray 默认行为(省略 == true),避免 30x 后的产品签名 (GeoServer Wicket /web/?0、Druid console、Spring Boot whitelabel)被静默丢失。 FollowRedirects 改 *bool 以区分"省略"与"false",显式 false 仍保持不跟随。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
仅含 {{...}}/§...§ 运行时标记的表达式才走 resolve+recompile,其余直接复用
已编译结果(common.Evaluate 对无标记表达式原样返回)。避免每条响应对上万
指纹模板重复解析+编译,缓解组内串行求值的 CPU 瓶颈。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- fetchFavicon 改用 r.Context() 而非页面请求 context,避免继承页面请求已耗尽的 时间预算,导致慢站点的 xray 风格 favicon 规则误判为不命中 - discoverIconURLs 用相对 "favicon.ico" 基于 base 解析 - attrRE / attrValue 支持未加引号的 link 属性(如 rel=icon href=/path) 补充 fetchFavicon 独立 context 与未加引号属性解析的单元测试。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
标准构建走 cookiejar.New;tinygo 下 cookiejar 不可用,newCookieJar 返回 nil, 使 xrayconv 等 tinygo 构建目标可编译通过。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
xray payload values are frequently written as the string(...) cast,
e.g. `entry: string("/")`. flattenPayloads ran each value through
normalizeXrayScalar, which only stripped bare quoted literals and
left the string(...) call intact. Those values are substituted
verbatim into the request path/headers, so the neutron executer
emitted URLs like `http://host:8848string("/")` -> invalid port.
Unwrap `string("<literal>")` to its inner literal (covers the empty
`string("")` and slash/dot paths). Verified against all stored
fingerprints: every leaked form is this single-literal shape.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…er middleware CyberHub already has a production-grade charsetNormalizingRoundTripper that handles charset detection and conversion at the HTTP transport layer, covering GBK/GB2312/Big5/Windows-1251 and more via golang.org/x/net/html/charset auto-detection with legacy Chinese heuristics. Duplicating a minimal subset inside neutron's readResponseBody adds an unnecessary golang.org/x/text dependency and creates two competing decode paths. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
TinyGo's primary target is WASM where the browser handles cookies and redirects via fetch(). Go-level CookieJar is never effectively used: Set-Cookie headers are stripped by the browser, CheckRedirect loop is removed in TinyGo, and our wasm-src doesn't even make HTTP requests from Go (JS fetches, Go only runs the matcher engine). Standard builds continue using net/http/cookiejar. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The rootURLExpansionSentinel and evaluateRequestData were added to prevent double path-prefix when RootURL already contains the mount prefix (e.g. /vpn/vpn/index.html). However PathPrefix has zero callers in CyberHub, mapping, or any downstream consumer — the feature was added speculatively. Revert to the direct common.Evaluate call that master uses. If path-prefix dedup is needed later, it can be re-introduced with a simpler pre-processing approach. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tests