mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-06-04 11:13:59 +08:00
feat: VMess URI 支持 TCP/H2 传输层
This commit is contained in:
parent
8cd0545023
commit
c5a417da8f
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sub-store",
|
||||
"version": "2.14.332",
|
||||
"version": "2.14.333",
|
||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
|
@ -305,8 +305,9 @@ function URI_VMess() {
|
||||
if (params.net === 'ws' || params.obfs === 'websocket') {
|
||||
proxy.network = 'ws';
|
||||
} else if (
|
||||
['tcp', 'http'].includes(params.net) ||
|
||||
params.obfs === 'http'
|
||||
['http'].includes(params.net) ||
|
||||
['http'].includes(params.obfs) ||
|
||||
['http'].includes(params.type)
|
||||
) {
|
||||
proxy.network = 'http';
|
||||
} else if (['grpc'].includes(params.net)) {
|
||||
@ -317,6 +318,8 @@ function URI_VMess() {
|
||||
) {
|
||||
proxy.network = 'ws';
|
||||
httpupgrade = true;
|
||||
} else if (params.net === 'h2' || proxy.network === 'h2') {
|
||||
proxy.network = 'h2';
|
||||
}
|
||||
if (proxy.network) {
|
||||
let transportHost = params.host ?? params.obfsParam;
|
||||
@ -332,6 +335,10 @@ function URI_VMess() {
|
||||
|
||||
if (proxy.network === 'http') {
|
||||
if (transportHost) {
|
||||
// 1)http(tcp)->host中间逗号(,)隔开
|
||||
transportHost = transportHost
|
||||
.split(',')
|
||||
.map((i) => i.trim());
|
||||
transportHost = Array.isArray(transportHost)
|
||||
? transportHost[0]
|
||||
: transportHost;
|
||||
|
Loading…
x
Reference in New Issue
Block a user