Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XHTTP config: Add "extra" for sharing extra fields #4000

Merged
merged 1 commit into from
Nov 11, 2024
Merged

XHTTP config: Add "extra" for sharing extra fields #4000

merged 1 commit into from
Nov 11, 2024

Conversation

RPRX
Copy link
Member

@RPRX RPRX commented Nov 11, 2024

这件事想了很久怎么设计,最终决定 直接分享原始 JSON其实前天突然写了 stream-up 模式就是为了上车

上个月我已说过,若要分享数量众多的、低频的、不断变化的这些参数,反复更新分享链接标准、等待各个 GUI 跟进绝对是灾难

况且这些参数层级、形式多样,设计进分享链接绝对酸爽,况且有些客户端根本就不给这些参数写 UI

正好原始 JSON 本身就已经以不冗杂的方式包含了所有信息,没有必要再重新设计一遍

若 extra 存在,则整个取代 xhttpSettings,除了 host、path、mode,比如下面生效的是 path-a 和 xmux-b:

                "xhttpSettings": {
                    "path": "/path-a",
                    "xmux": {
                        (xmux-a)
                    },
                    "extra": {
                        "path": "/path-b",
                        "xmux": {
                            (xmux-b)
                        }
                    }
                }

可能出于安全考虑目前填在 extra 中的 downloadSettings 会被删掉 sockopt,虽然 downloadSettings 还是比上行能分享的内容更多,似乎不太公平,但又不好往外移 extra,否则不如不断外移、直接做 Xray JSON 订阅,结果分享链接还是残的

XHTTP 分享链接标准已加上 mode 和 extra(客户端至少应当有这四个参数),并跟进了近期 Xray-core 的改动:#716

补充说明:#3994 (comment) #3994 (comment)

extra基本上就是给分享用的
分包上行设置 xmux 上下行分离这些
如果要修改 都由服务发布者写好 分享给其他人
还有xpadding
其实本来就不应该交由客户端随便改

比如新的 noGRPCHeader 也应由服务发布者决定
而有 UI 的 host、path、mode,服务端都能限制

@RPRX RPRX merged commit bd0841a into main Nov 11, 2024
36 checks passed
@RPRX RPRX deleted the xhttp-extra branch November 11, 2024 04:23
2dust added a commit to 2dust/v2rayN that referenced this pull request Nov 14, 2024
@yuhan6665
Copy link
Member

文档更新了 XTLS/Xray-docs-next@8a908de
分享 JSON 也行 不过我觉得 JSON 里面有太多冗余信息 将来大概还是需要一个分享 mux/split/proxy chain 的方案 daeuniverse/dae#236

@RPRX
Copy link
Member Author

RPRX commented Nov 18, 2024

@yuhan6665 感谢!文件需更名为 xhttp.md,括号原名的话也给 RAW 备注个 TCP,另外文档左下角底层传输顺序改一下:

  • RAW (TCP)
  • XHTTP (SplitHTTP)
  • gRPC
  • HTTP
  • WebSocket
  • HTTPUpgrade
  • mKCP

@RPRX
Copy link
Member Author

RPRX commented Nov 18, 2024

不过我觉得 JSON 里面有太多冗余信息

我觉得 Xray 的有些 JSON 需要先简化,但底层传输的字段都很有用、没什么冗余的,这也是我限定 extra 在底层传输的原因之一

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.

2 participants