Skip to content

Commit 2d5ed65

Browse files
committed
feat: VMess 支持 kcp/quic
1 parent 9e00282 commit 2d5ed65

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sub-store",
3-
"version": "2.19.52",
3+
"version": "2.19.53",
44
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
55
"main": "src/main.js",
66
"scripts": {

backend/src/core/proxy-utils/parsers/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,8 @@ function URI_VMess() {
473473
['http'].includes(params.type)
474474
) {
475475
proxy.network = 'http';
476-
} else if (['grpc'].includes(params.net)) {
477-
proxy.network = 'grpc';
476+
} else if (['grpc', 'kcp', 'quic'].includes(params.net)) {
477+
proxy.network = params.net;
478478
} else if (
479479
params.net === 'httpupgrade' ||
480480
proxy.network === 'httpupgrade'
@@ -542,6 +542,10 @@ function URI_VMess() {
542542
}
543543
proxy[`${proxy.network}-opts`] = opts;
544544
}
545+
} else if (['kcp', 'quic'].includes(proxy.network)) {
546+
proxy[`${proxy.network}-opts`] = {
547+
[`_${proxy.network}-type`]: getIfNotBlank(params.type),
548+
};
545549
} else {
546550
delete proxy.network;
547551
}

backend/src/core/proxy-utils/producers/uri.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,16 @@ export default function URI_Producer() {
156156
'gun';
157157
result.host =
158158
proxy[`${proxy.network}-opts`]?.['_grpc-authority'];
159+
} else if (['kcp', 'quic'].includes(proxy.network)) {
160+
result.path =
161+
proxy[`${proxy.network}-opts`]?.[
162+
'grpc-service-name'
163+
];
164+
// https://github.com/XTLS/Xray-core/issues/91
165+
result.type =
166+
proxy[`${proxy.network}-opts`]?.[
167+
`_${proxy.network}-type`
168+
] || 'none';
159169
}
160170
}
161171
result = 'vmess://' + Base64.encode(JSON.stringify(result));

0 commit comments

Comments
 (0)