Skip to content

Commit

Permalink
feat: 支持 VLESS XHTTP extra
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Jan 22, 2025
1 parent 48aaaf5 commit b1874e5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.16.18",
"version": "2.16.19",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js",
"scripts": {
Expand Down
3 changes: 3 additions & 0 deletions backend/src/core/proxy-utils/parsers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,9 @@ function URI_VLESS() {
// mKCP 的伪装头部类型。当前可选值有 none / srtp / utp / wechat-video / dtls / wireguard。省略时默认值为 none,即不使用伪装头部,但不可以为空字符串。
proxy.headerType = params.headerType || 'none';
}
if (params.extra) {
proxy.extra = params.extra;
}
}

return proxy;
Expand Down
6 changes: 5 additions & 1 deletion backend/src/core/proxy-utils/producers/uri.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ export default function URI_Producer() {
if (proxy.flow) {
flow = `&flow=${encodeURIComponent(proxy.flow)}`;
}
let extra = '';
if (proxy.extra) {
extra = `&extra=${encodeURIComponent(proxy.extra)}`;
}
let vlessType = proxy.network;
if (
proxy.network === 'ws' &&
Expand Down Expand Up @@ -254,7 +258,7 @@ export default function URI_Producer() {
proxy.port
}?security=${encodeURIComponent(
security,
)}${vlessTransport}${alpn}${allowInsecure}${sni}${fp}${flow}${sid}${pbk}#${encodeURIComponent(
)}${vlessTransport}${alpn}${allowInsecure}${sni}${fp}${flow}${sid}${pbk}${extra}#${encodeURIComponent(
proxy.name,
)}`;
break;
Expand Down

0 comments on commit b1874e5

Please sign in to comment.