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