feat: Added dedicated Stash producer

This commit is contained in:
Peng-YM
2022-06-20 21:51:13 +08:00
parent bea2c64e40
commit d602dbeb7c
8 changed files with 39 additions and 14 deletions

View File

@@ -1,11 +1,16 @@
export default function Clash_Producer() {
const type = 'ALL';
const produce = (proxies) => {
proxies.filter((proxy) => {
if (proxy.type === 'vless') return false;
return true;
});
return (
'proxies:\n' +
proxies
.map((proxy) => {
delete proxy.supported;
delete proxy['tls-fingerprint'];
delete proxy['vmess-aead'];
return ' - ' + JSON.stringify(proxy) + '\n';
})
.join('')

View File

@@ -1,5 +1,6 @@
import Surge_Producer from './surge';
import Clash_Producer from './clash';
import Stash_Producer from './stash';
import Loon_Producer from './loon';
import URI_Producer from './uri';
import QX_Producer from './qx';
@@ -17,4 +18,5 @@ export default {
Clash: Clash_Producer(),
URI: URI_Producer(),
JSON: JSON_Producer(),
Stash: Stash_Producer(),
};

View File

@@ -0,0 +1,16 @@
export default function Stash_Producer() {
const type = 'ALL';
const produce = (proxies) => {
return (
'proxies:\n' +
proxies
.map((proxy) => {
delete proxy['tls-fingerprint'];
delete proxy['vmess-aead'];
return ' - ' + JSON.stringify(proxy) + '\n';
})
.join('')
);
};
return { type, produce };
}