mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-11 00:39:01 +08:00
Fixed some default parameter errors
This commit is contained in:
parent
fe5dcd2a1b
commit
0d1e0588c5
@ -1646,11 +1646,16 @@ function QX_Producer() {
|
|||||||
case "ss":
|
case "ss":
|
||||||
obfs_opts = "";
|
obfs_opts = "";
|
||||||
if (proxy.plugin === "obfs") {
|
if (proxy.plugin === "obfs") {
|
||||||
obfs_opts = `,obfs=${proxy["plugin-opts"].mode},obfs-host=${proxy["plugin-opts"].host}`;
|
const {host, mode} = proxy['plugin-opts'];
|
||||||
|
obfs_opts = `, obfs=${mode}${
|
||||||
|
host ? ", obfs-host=" + host : ""
|
||||||
|
}`;
|
||||||
}
|
}
|
||||||
if (proxy.plugin === "v2ray-plugin") {
|
if (proxy.plugin === "v2ray-plugin") {
|
||||||
const {tls, host, path} = proxy["plugin-opts"];
|
const {tls, host, path} = proxy["plugin-opts"];
|
||||||
obfs_opts = `,obfs=${tls ? "wss" : "ws"},obfs-host=${host}${
|
obfs_opts = `, obfs=${tls ? "wss" : "ws"}${
|
||||||
|
host ? ", obfs-host=" + host : ""
|
||||||
|
}${
|
||||||
path ? ", obfs-uri=" + path : ""
|
path ? ", obfs-uri=" + path : ""
|
||||||
}`;
|
}`;
|
||||||
}
|
}
|
||||||
@ -1679,20 +1684,24 @@ function QX_Producer() {
|
|||||||
// websocket
|
// websocket
|
||||||
if (proxy.tls) {
|
if (proxy.tls) {
|
||||||
// ws-tls
|
// ws-tls
|
||||||
obfs_opts = `,obfs=wss,obfs-host=${proxy.sni}${
|
obfs_opts = `, obfs=wss${
|
||||||
|
proxy.sni ? ", obfs-host=" + proxy.sni : ""
|
||||||
|
}${
|
||||||
proxy["ws-path"] ? ", obfs-uri=" + proxy["ws-path"] : ""
|
proxy["ws-path"] ? ", obfs-uri=" + proxy["ws-path"] : ""
|
||||||
}, tls-verification=${proxy.scert ? "false" : "true"}`;
|
}, tls-verification=${proxy.scert ? "false" : "true"}`;
|
||||||
} else {
|
} else {
|
||||||
// ws
|
// ws
|
||||||
obfs_opts = `,obfs=ws,obfs-host=${proxy["ws-headers"].Host}${
|
obfs_opts = `,obfs=ws,${
|
||||||
|
proxy["ws-headers"].Host ? ", obfs-host=" + proxy["ws-headers"].Host : ""
|
||||||
|
}${
|
||||||
proxy["ws-path"] ? ", obfs-uri=" + proxy["ws-path"] : ""
|
proxy["ws-path"] ? ", obfs-uri=" + proxy["ws-path"] : ""
|
||||||
}`;
|
}`;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// tcp
|
// tcp
|
||||||
if (proxy.tls) {
|
if (proxy.tls) {
|
||||||
obfs_opts = `,obfs=over-tls,obfs-host=${
|
obfs_opts = `, obfs=over-tls${
|
||||||
proxy.sni
|
proxy.sni ? ", obfs-host=" + proxy.sni : ""
|
||||||
}, tls-verification=${proxy.scert ? "false" : "true"}`;
|
}, tls-verification=${proxy.scert ? "false" : "true"}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1716,7 +1725,9 @@ function QX_Producer() {
|
|||||||
if (proxy.tls) {
|
if (proxy.tls) {
|
||||||
tls_opts = `, over-tls=true, tls-verification=${
|
tls_opts = `, over-tls=true, tls-verification=${
|
||||||
proxy.scert ? "false" : "true"
|
proxy.scert ? "false" : "true"
|
||||||
},tls-host=${proxy.sni}`;
|
}${
|
||||||
|
proxy.sni ? ", tls-host=" + proxy.sni : ""
|
||||||
|
}`;
|
||||||
}
|
}
|
||||||
return `http=${proxy.server}:${proxy.port}, username=${
|
return `http=${proxy.server}:${proxy.port}, username=${
|
||||||
proxy.username
|
proxy.username
|
||||||
@ -1741,7 +1752,7 @@ function Loon_Producer() {
|
|||||||
if (proxy.plugin) {
|
if (proxy.plugin) {
|
||||||
if (proxy.plugin === "obfs") {
|
if (proxy.plugin === "obfs") {
|
||||||
const {mode, host} = proxy["plugin-opts"];
|
const {mode, host} = proxy["plugin-opts"];
|
||||||
obfs_opts = `,${mode},${host}`;
|
obfs_opts = `,${mode},${host || ""}`;
|
||||||
} else {
|
} else {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Platform ${targetPlatform} does not support obfs option: ${proxy.obfs}`
|
`Platform ${targetPlatform} does not support obfs option: ${proxy.obfs}`
|
||||||
@ -1751,11 +1762,11 @@ function Loon_Producer() {
|
|||||||
|
|
||||||
return `${proxy.name}=shadowsocks, ${proxy.server}, ${proxy.port}, ${proxy.cipher}, "${proxy.password}"${obfs_opts}`;
|
return `${proxy.name}=shadowsocks, ${proxy.server}, ${proxy.port}, ${proxy.cipher}, "${proxy.password}"${obfs_opts}`;
|
||||||
case "ssr":
|
case "ssr":
|
||||||
return `${proxy.name}=shadowsocksr,${proxy.server},${proxy.port},${proxy.cipher},"${proxy.password}",${proxy.protocol},{${proxy["protocol-param"]}},${proxy.obfs},{${proxy["obfs-param"]}}`;
|
return `${proxy.name}=shadowsocksr, ${proxy.server}, ${proxy.port}, ${proxy.cipher}, "${proxy.password}", ${proxy.protocol}, {${proxy["protocol-param"] || ""}}, ${proxy.obfs}, {${proxy["obfs-param"] || ""}}`;
|
||||||
case "vmess":
|
case "vmess":
|
||||||
obfs_opts = "";
|
obfs_opts = "";
|
||||||
if (proxy.network === "ws") {
|
if (proxy.network === "ws") {
|
||||||
const host = proxy["ws-headers"].Host;
|
const host = proxy["ws-headers"].Host || proxy.server;
|
||||||
obfs_opts = `, transport:ws, host:${host}, path:${
|
obfs_opts = `, transport:ws, host:${host}, path:${
|
||||||
proxy["ws-path"] || "/"
|
proxy["ws-path"] || "/"
|
||||||
}`;
|
}`;
|
||||||
@ -1763,15 +1774,19 @@ function Loon_Producer() {
|
|||||||
obfs_opts = `, transport:tcp`;
|
obfs_opts = `, transport:tcp`;
|
||||||
}
|
}
|
||||||
if (proxy.tls) {
|
if (proxy.tls) {
|
||||||
obfs_opts += `,tls-name=${proxy.sni},skip-cert-verify:${proxy.scert}`;
|
obfs_opts += `${
|
||||||
|
proxy.sni ? ", tls-name:" + proxy.sni : ""
|
||||||
|
},skip-cert-verify:${proxy.scert || "false"}`;
|
||||||
}
|
}
|
||||||
return `${proxy.name}=vmess, ${proxy.server}, ${proxy.port}, ${
|
return `${proxy.name}=vmess, ${proxy.server}, ${proxy.port}, ${
|
||||||
proxy.cipher === "auto" ? "none" : proxy.cipher
|
proxy.cipher === "auto" ? "none" : proxy.cipher
|
||||||
},"${proxy.uuid}",over-tls:${proxy.tls}${obfs_opts}`;
|
}, "${proxy.uuid}", over-tls:${proxy.tls || "false"}${obfs_opts}`;
|
||||||
case "trojan":
|
case "trojan":
|
||||||
return `${proxy.name}=trojan, ${proxy.server}, ${proxy.port}, "${
|
return `${proxy.name}=trojan, ${proxy.server}, ${proxy.port}, "${
|
||||||
proxy.password
|
proxy.password
|
||||||
}"${proxy.sni ? ",tls-name:" + proxy.sni : ""},skip-cert-verify:${
|
}"${
|
||||||
|
proxy.sni ? ", tls-name:" + proxy.sni : ""
|
||||||
|
}, skip-cert-verify:${
|
||||||
proxy.scert || "false"
|
proxy.scert || "false"
|
||||||
}`;
|
}`;
|
||||||
case "http":
|
case "http":
|
||||||
@ -1781,7 +1796,9 @@ function Loon_Producer() {
|
|||||||
}, ${proxy.port}, ${proxy.username || ""}, ${proxy.password || ""}`;
|
}, ${proxy.port}, ${proxy.username || ""}, ${proxy.password || ""}`;
|
||||||
if (proxy.tls) {
|
if (proxy.tls) {
|
||||||
// https
|
// https
|
||||||
tls_opts = `,skip-cert-verify:${proxy.scert},tls-name:${proxy.sni}`;
|
tls_opts = `${
|
||||||
|
proxy.sni ? ", tls-name:" + proxy.sni : ""
|
||||||
|
}, skip-cert-verify:${proxy.scert}`;
|
||||||
return base + tls_opts;
|
return base + tls_opts;
|
||||||
} else return base;
|
} else return base;
|
||||||
}
|
}
|
||||||
@ -1800,8 +1817,11 @@ function Surge_Producer() {
|
|||||||
case "ss":
|
case "ss":
|
||||||
obfs_opts = "";
|
obfs_opts = "";
|
||||||
if (proxy.plugin) {
|
if (proxy.plugin) {
|
||||||
|
const {host, mode} = proxy['plugin-opts'];
|
||||||
if (proxy.plugin === "obfs") {
|
if (proxy.plugin === "obfs") {
|
||||||
obfs_opts = `,obfs=${proxy["plugin-opts"].mode},obfs-host=${proxy["plugin-opts"].host}`;
|
obfs_opts = `, obfs=${mode}${
|
||||||
|
host ? ", obfs-host=" + host : ""
|
||||||
|
}`;
|
||||||
} else {
|
} else {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Platform ${targetPlatform} does not support obfs option: ${proxy.obfs}`
|
`Platform ${targetPlatform} does not support obfs option: ${proxy.obfs}`
|
||||||
@ -1817,9 +1837,9 @@ function Surge_Producer() {
|
|||||||
tls_opts = "";
|
tls_opts = "";
|
||||||
let config = `${proxy.name}=vmess, ${proxy.server},${
|
let config = `${proxy.name}=vmess, ${proxy.server},${
|
||||||
proxy.port
|
proxy.port
|
||||||
},username=${proxy.uuid},tls=${proxy.tls},tfo=${proxy.tfo || "false"}`;
|
}, username=${proxy.uuid}, tls=${proxy.tls || "false"}, tfo=${proxy.tfo || "false"}`;
|
||||||
if (proxy.network === "ws") {
|
if (proxy.network === "ws") {
|
||||||
const path = proxy["ws-path"];
|
const path = proxy["ws-path"] || "/";
|
||||||
const host = proxy["ws-headers"].Host;
|
const host = proxy["ws-headers"].Host;
|
||||||
config += `, ws=true${path ? ", ws-path=" + path : ""}${
|
config += `, ws=true${path ? ", ws-path=" + path : ""}${
|
||||||
host ? ", ws-headers=HOST:" + host : ""
|
host ? ", ws-headers=HOST:" + host : ""
|
||||||
|
2
backend/sub-store.min.js
vendored
2
backend/sub-store.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user