mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-10 11:28:59 +08:00
fix: transport headers may have no Host
This commit is contained in:
parent
8bfa4dbbf2
commit
49c7107d20
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sub-store",
|
"name": "sub-store",
|
||||||
"version": "2.14.31",
|
"version": "2.14.32",
|
||||||
"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": {
|
||||||
|
@ -101,7 +101,7 @@ function trojan(proxy) {
|
|||||||
'ws-opts.path',
|
'ws-opts.path',
|
||||||
);
|
);
|
||||||
result.appendIfPresent(
|
result.appendIfPresent(
|
||||||
`,host=${proxy['ws-opts'].headers.Host}`,
|
`,host=${proxy['ws-opts']?.headers?.Host}`,
|
||||||
'ws-opts.headers.Host',
|
'ws-opts.headers.Host',
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@ -138,11 +138,11 @@ function vmess(proxy) {
|
|||||||
if (proxy.network === 'ws') {
|
if (proxy.network === 'ws') {
|
||||||
result.append(`,transport=ws`);
|
result.append(`,transport=ws`);
|
||||||
result.appendIfPresent(
|
result.appendIfPresent(
|
||||||
`,path=${proxy['ws-opts'].path}`,
|
`,path=${proxy['ws-opts']?.path}`,
|
||||||
'ws-opts.path',
|
'ws-opts.path',
|
||||||
);
|
);
|
||||||
result.appendIfPresent(
|
result.appendIfPresent(
|
||||||
`,host=${proxy['ws-opts'].headers.Host}`,
|
`,host=${proxy['ws-opts']?.headers?.Host}`,
|
||||||
'ws-opts.headers.Host',
|
'ws-opts.headers.Host',
|
||||||
);
|
);
|
||||||
} else if (proxy.network === 'http') {
|
} else if (proxy.network === 'http') {
|
||||||
@ -205,11 +205,11 @@ function vless(proxy) {
|
|||||||
if (proxy.network === 'ws') {
|
if (proxy.network === 'ws') {
|
||||||
result.append(`,transport=ws`);
|
result.append(`,transport=ws`);
|
||||||
result.appendIfPresent(
|
result.appendIfPresent(
|
||||||
`,path=${proxy['ws-opts'].path}`,
|
`,path=${proxy['ws-opts']?.path}`,
|
||||||
'ws-opts.path',
|
'ws-opts.path',
|
||||||
);
|
);
|
||||||
result.appendIfPresent(
|
result.appendIfPresent(
|
||||||
`,host=${proxy['ws-opts'].headers.Host}`,
|
`,host=${proxy['ws-opts']?.headers?.Host}`,
|
||||||
'ws-opts.headers.Host',
|
'ws-opts.headers.Host',
|
||||||
);
|
);
|
||||||
} else if (proxy.network === 'http') {
|
} else if (proxy.network === 'http') {
|
||||||
|
@ -135,11 +135,11 @@ function trojan(proxy) {
|
|||||||
if (needTls(proxy)) append(`,obfs=wss`);
|
if (needTls(proxy)) append(`,obfs=wss`);
|
||||||
else append(`,obfs=ws`);
|
else append(`,obfs=ws`);
|
||||||
appendIfPresent(
|
appendIfPresent(
|
||||||
`,obfs-uri=${proxy['ws-opts'].path}`,
|
`,obfs-uri=${proxy['ws-opts']?.path}`,
|
||||||
'ws-opts.path',
|
'ws-opts.path',
|
||||||
);
|
);
|
||||||
appendIfPresent(
|
appendIfPresent(
|
||||||
`,obfs-host=${proxy['ws-opts'].headers.Host}`,
|
`,obfs-host=${proxy['ws-opts']?.headers?.Host}`,
|
||||||
'ws-opts.headers.Host',
|
'ws-opts.headers.Host',
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user