fix: 修复 mux

This commit is contained in:
xream committed 2026-04-05 13:35:30 +08:00
1 parent c24189430b
commit 404df83d52
7 files changed
+11 -28

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.21.76",
"version": "2.21.77",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
"main": "src/main.js",
"scripts": {
@@ -160,10 +160,7 @@ export default function Clash_Producer() {
proxy[`${proxy.network}-opts`].path = '/';
}
}
let mux = proxy['plugin-opts']?.mux;
if (mux != null && typeof mux !== 'boolean') {
proxy['plugin-opts'].mux = mux > 0 ? true : false;
}
if (proxy['plugin-opts']?.tls) {
if (isPresent(proxy, 'skip-cert-verify')) {
proxy['plugin-opts']['skip-cert-verify'] =
@@ -239,10 +239,6 @@ export default function ClashMeta_Producer() {
}
}
let mux = proxy['plugin-opts']?.mux;
if (mux != null && typeof mux !== 'boolean') {
proxy['plugin-opts'].mux = mux > 0 ? true : false;
}
if (proxy['plugin-opts']?.tls) {
if (isPresent(proxy, 'skip-cert-verify')) {
proxy['plugin-opts']['skip-cert-verify'] =
@@ -214,10 +214,7 @@ export default function Shadowrocket_Producer() {
proxy[`${proxy.network}-opts`].path = '/';
}
}
let mux = proxy['plugin-opts']?.mux;
if (mux != null && typeof mux !== 'boolean') {
proxy['plugin-opts'].mux = mux > 0 ? true : false;
}
if (proxy['plugin-opts']?.tls) {
if (isPresent(proxy, 'skip-cert-verify')) {
proxy['plugin-opts']['skip-cert-verify'] =
@@ -265,11 +265,7 @@ const normalizePemLines = (value, label) => {
if (lines.some((line) => /^-----BEGIN [A-Za-z0-9 -]+-----$/.test(line))) {
return lines;
}
return [
`-----BEGIN ${label}-----`,
...lines,
`-----END ${label}-----`,
];
return [`-----BEGIN ${label}-----`, ...lines, `-----END ${label}-----`];
};
const tlsParser = (proxy, parsedProxy) => {
@@ -281,10 +281,7 @@ export default function Stash_Producer() {
proxy[`${proxy.network}-opts`].path = '/';
}
}
let mux = proxy['plugin-opts']?.mux;
if (mux != null && typeof mux !== 'boolean') {
proxy['plugin-opts'].mux = mux > 0 ? true : false;
}
if (proxy['plugin-opts']?.tls) {
if (isPresent(proxy, 'skip-cert-verify')) {
proxy['plugin-opts']['skip-cert-verify'] =
@@ -520,7 +520,7 @@ describe('Proxy structured producers', function () {
});
});
it('normalizes numeric v2ray-plugin mux values across Clash-family YAML producers', function () {
it('preserves numeric v2ray-plugin mux values across Clash-family YAML producers', function () {
const buildProxy = (name, mux) => ({
type: 'ss',
name,
@@ -557,7 +557,7 @@ describe('Proxy structured producers', function () {
'plugin-opts': {
tls: true,
'skip-cert-verify': true,
mux: true,
mux: 1,
},
});
expectSubset(internal[1], {
@@ -565,7 +565,7 @@ describe('Proxy structured producers', function () {
'plugin-opts': {
tls: true,
'skip-cert-verify': true,
mux: false,
mux: 0,
},
});
}
@@ -609,7 +609,7 @@ describe('Proxy structured producers', function () {
});
});
it('keeps normalized v2ray-plugin mux state in sing-box plugin opts', function () {
it('keeps numeric v2ray-plugin mux state in sing-box plugin opts', function () {
const buildProxy = (name, mux) => ({
type: 'ss',
name,
@@ -647,7 +647,7 @@ describe('Proxy structured producers', function () {
enabled: true,
},
});
expect(muxOn.plugin_opts).to.include('mux=true');
expect(muxOn.plugin_opts).to.include('mux=1');
expectSubset(muxOff, {
tag: 'Sing-box Mux Off',
@@ -655,7 +655,7 @@ describe('Proxy structured producers', function () {
plugin: 'v2ray-plugin',
});
expect(muxOff).to.not.have.property('multiplex');
expect(muxOff.plugin_opts).to.include('mux=false');
expect(muxOff.plugin_opts).to.include('mux=0');
});
it('emits sing-box outbounds with reality tls and websocket transport', function () {