Skip to content

Commit c902ad8

Browse files
committed
fix: 修复 sing-box vless 传输层
1 parent 10fe493 commit c902ad8

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

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.93",
3+
"version": "2.19.94",
44
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
55
"main": "src/main.js",
66
"scripts": {

backend/src/core/proxy-utils/producers/sing-box.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ const h1Parser = (proxy, parsedProxy) => {
181181
host = `${host}`.split(',').map((i) => i.trim());
182182
if (host.length > 0) transport.host = host;
183183
}
184-
if (!transport.host) return;
184+
// if (!transport.host) return;
185185
if (proxy['http-path'] && proxy['http-path'] !== '') {
186186
const path = proxy['http-path'];
187187
if (Array.isArray(path)) {
@@ -190,7 +190,7 @@ const h1Parser = (proxy, parsedProxy) => {
190190
}
191191
if (parsedProxy.tls.insecure)
192192
parsedProxy.tls.server_name = transport.host[0];
193-
if (transport.host.length === 1) transport.host = transport.host[0];
193+
if (transport.host?.length === 1) transport.host = transport.host[0];
194194
for (const key of Object.keys(transport.headers)) {
195195
const value = transport.headers[key];
196196
if (value.length === 1) transport.headers[key] = value[0];
@@ -569,6 +569,8 @@ const vlessParser = (proxy = {}) => {
569569
// if (['xtls-rprx-vision', ''].includes(proxy.flow)) parsedProxy.flow = proxy.flow;
570570
if (proxy.flow != null) parsedProxy.flow = proxy.flow;
571571
if (proxy.network === 'ws') wsParser(proxy, parsedProxy);
572+
if (proxy.network === 'h2') h2Parser(proxy, parsedProxy);
573+
if (proxy.network === 'http') h1Parser(proxy, parsedProxy);
572574
if (proxy.network === 'grpc') grpcParser(proxy, parsedProxy);
573575
networkParser(proxy, parsedProxy);
574576
tfoParser(proxy, parsedProxy);

0 commit comments

Comments
 (0)