mirror of
https://github.com/sub-store-org/Sub-Store.git
synced 2026-11-30 16:38:30 +00:00
Merge pull request #595 from ocd0711/master
fix: remove quotes from Loon shadow-tls password
This commit is contained in:
2 files changed
+42
-4
No files matched your search
@@ -158,7 +158,7 @@ function shadowsocks(proxy) {
|
||||
|
||||
// shadow-tls
|
||||
if (isPresent(proxy, 'shadow-tls-password')) {
|
||||
result.append(`,shadow-tls-password="${proxy['shadow-tls-password']}"`);
|
||||
result.append(`,shadow-tls-password=${proxy['shadow-tls-password']}`);
|
||||
|
||||
result.appendIfPresent(
|
||||
`,shadow-tls-version=${proxy['shadow-tls-version']}`,
|
||||
@@ -175,7 +175,7 @@ function shadowsocks(proxy) {
|
||||
const host = proxy['plugin-opts'].host;
|
||||
const version = proxy['plugin-opts'].version;
|
||||
if (password) {
|
||||
result.append(`,shadow-tls-password="${password}"`);
|
||||
result.append(`,shadow-tls-password=${password}`);
|
||||
if (host) {
|
||||
result.append(`,shadow-tls-sni=${host}`);
|
||||
}
|
||||
@@ -252,7 +252,7 @@ function shadowsocksr(proxy) {
|
||||
|
||||
// shadow-tls
|
||||
if (isPresent(proxy, 'shadow-tls-password')) {
|
||||
result.append(`,shadow-tls-password="${proxy['shadow-tls-password']}"`);
|
||||
result.append(`,shadow-tls-password=${proxy['shadow-tls-password']}`);
|
||||
|
||||
result.appendIfPresent(
|
||||
`,shadow-tls-version=${proxy['shadow-tls-version']}`,
|
||||
@@ -269,7 +269,7 @@ function shadowsocksr(proxy) {
|
||||
const host = proxy['plugin-opts'].host;
|
||||
const version = proxy['plugin-opts'].version;
|
||||
if (password) {
|
||||
result.append(`,shadow-tls-password="${password}"`);
|
||||
result.append(`,shadow-tls-password=${password}`);
|
||||
if (host) {
|
||||
result.append(`,shadow-tls-sni=${host}`);
|
||||
}
|
||||
|
||||
@@ -433,6 +433,44 @@ describe('Proxy text producers', function () {
|
||||
);
|
||||
});
|
||||
|
||||
it('produces Loon Shadowsocks Shadow TLS passwords without quotes', function () {
|
||||
const output = produceExternal('Loon', [
|
||||
{
|
||||
type: 'ss',
|
||||
name: 'Loon SS ShadowTLS Fields',
|
||||
server: 'ss.example.com',
|
||||
port: 8388,
|
||||
cipher: 'chacha20-ietf-poly1305',
|
||||
password: 'ss-pass',
|
||||
'shadow-tls-password': 'dzUjK3l+mXO/xxx=',
|
||||
'shadow-tls-sni': 'p11.douyinpic.com',
|
||||
'shadow-tls-version': 3,
|
||||
udp: true,
|
||||
},
|
||||
{
|
||||
type: 'ss',
|
||||
name: 'Loon SS ShadowTLS Plugin',
|
||||
server: 'ss-plugin.example.com',
|
||||
port: 8388,
|
||||
cipher: 'chacha20-ietf-poly1305',
|
||||
password: 'ss-pass',
|
||||
plugin: 'shadow-tls',
|
||||
'plugin-opts': {
|
||||
password: 'plugin-shadow-pass',
|
||||
host: 'mask.example.com',
|
||||
version: 3,
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
expect(output).to.equal(
|
||||
[
|
||||
'Loon SS ShadowTLS Fields=shadowsocks,ss.example.com,8388,chacha20-ietf-poly1305,"ss-pass",shadow-tls-password=dzUjK3l+mXO/xxx=,shadow-tls-version=3,shadow-tls-sni=p11.douyinpic.com,udp=true',
|
||||
'Loon SS ShadowTLS Plugin=shadowsocks,ss-plugin.example.com,8388,chacha20-ietf-poly1305,"ss-pass",shadow-tls-password=plugin-shadow-pass,shadow-tls-sni=mask.example.com,shadow-tls-version=3',
|
||||
].join('\n'),
|
||||
);
|
||||
});
|
||||
|
||||
it('emits Loon tls-profile and alpn for TLS protocol outputs', function () {
|
||||
const alpn = ['http/1.1', 'h2', 'h3'];
|
||||
const output = produceExternal('Loon', [
|
||||
|
||||
Reference in new issue
Block a user