feat: VMess 支持 kcp/quic

This commit is contained in:
xream 2025-05-27 00:34:31 +08:00
parent 9e0028219d
commit 2d5ed65f8d
No known key found for this signature in database
GPG Key ID: 1D2C5225471789F9
3 changed files with 17 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.19.52",
"version": "2.19.53",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
"main": "src/main.js",
"scripts": {

View File

@ -473,8 +473,8 @@ function URI_VMess() {
['http'].includes(params.type)
) {
proxy.network = 'http';
} else if (['grpc'].includes(params.net)) {
proxy.network = 'grpc';
} else if (['grpc', 'kcp', 'quic'].includes(params.net)) {
proxy.network = params.net;
} else if (
params.net === 'httpupgrade' ||
proxy.network === 'httpupgrade'
@ -542,6 +542,10 @@ function URI_VMess() {
}
proxy[`${proxy.network}-opts`] = opts;
}
} else if (['kcp', 'quic'].includes(proxy.network)) {
proxy[`${proxy.network}-opts`] = {
[`_${proxy.network}-type`]: getIfNotBlank(params.type),
};
} else {
delete proxy.network;
}

View File

@ -156,6 +156,16 @@ export default function URI_Producer() {
'gun';
result.host =
proxy[`${proxy.network}-opts`]?.['_grpc-authority'];
} else if (['kcp', 'quic'].includes(proxy.network)) {
result.path =
proxy[`${proxy.network}-opts`]?.[
'grpc-service-name'
];
// https://github.com/XTLS/Xray-core/issues/91
result.type =
proxy[`${proxy.network}-opts`]?.[
`_${proxy.network}-type`
] || 'none';
}
}
result = 'vmess://' + Base64.encode(JSON.stringify(result));