fix: xhttp-reality parsing

This commit is contained in:
FUFSoB committed 2026-06-18 12:19:17 +05:00
1 parent 433a13ccad
commit 759bde8b29
2 files changed
+38 -8

No files matched your search

+10 -6
View File
@@ -43,6 +43,8 @@ def _xray_tls(tls: dict | None) -> tuple[str, dict]:
"shortId": reality.get("short_id", ""),
}
utls = tls.get("utls", {})
if reality.get("spider_x"):
settings["spiderX"] = reality["spider_x"]
if utls.get("enabled") and utls.get("fingerprint"):
settings["fingerprint"] = utls["fingerprint"]
return "reality", {"realitySettings": settings}
@@ -81,12 +83,14 @@ def _xray_transport(transport: dict | None) -> tuple[str, dict]:
if t == "quic":
return "quic", {}
if t == "xhttp":
return "xhttp", {
"xhttpSettings": {
"host": transport.get("host", ""),
"path": transport.get("path", "/"),
}
}
settings = {"path": transport.get("path", "/")}
if transport.get("host"):
settings["host"] = transport["host"]
if transport.get("mode"):
settings["mode"] = transport["mode"]
if transport.get("extra") is not None:
settings["extra"] = transport["extra"]
return "xhttp", {"xhttpSettings": settings}
return t, {}