Skip to content

Commit

Permalink
fix: 由于 mellow 对 shadowsocks 支持有限,忽略该类型节点
Browse files Browse the repository at this point in the history
  • Loading branch information
geekdada committed Nov 13, 2019
1 parent b646199 commit 8ae0561
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 19 deletions.
7 changes: 1 addition & 6 deletions lib/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ export const getClashNodes = (
};

export const getMellowNodes = (
list: ReadonlyArray<ShadowsocksNodeConfig|VmessNodeConfig>,
list: ReadonlyArray<VmessNodeConfig>,
filter?: NodeFilterType
): string => {
const result = list
Expand All @@ -575,11 +575,6 @@ export const getMellowNodes = (
if (nodeConfig.enable === false) { return null; }

switch (nodeConfig.type) {
case NodeTypeEnum.Shadowsocks: {
const uri = getShadowsocksNodes([nodeConfig]);
return [nodeConfig.nodeName, 'ss', uri.trim()].join(', ');
}

case NodeTypeEnum.Vmess: {
const uri = formatVmessUri(nodeConfig);
return [nodeConfig.nodeName, 'vmess1', uri.trim().replace('vmess://', 'vmess1://')].join(', ');
Expand Down
1 change: 0 additions & 1 deletion test/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ test('cli works', async t => {
cwd: resolve('plain'),
execArgv: ['--require', require.resolve('./stub-axios.js')],
})
.debug()
.end();

t.is(code, 0);
Expand Down
14 changes: 2 additions & 12 deletions test/snapshots/cli.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,5 @@ Generated by [AVA](https://ava.li).
----␊
测试中文 = external, exec = "/usr/local/bin/ssr-local", args = "-s", args = "127.0.0.1", args = "-p", args = "1234", args = "-m", args = "aes-128-cfb", args = "-o", args = "tls1.2_ticket_auth", args = "-O", args = "auth_aes128_md5", args = "-k", args = "aaabbb", args = "-l", args = "61107", args = "-b", args = "127.0.0.1", args = "-g", args = "breakwa11.moe", local-port = 61107, addresses = 127.0.0.1␊
----␊
🇺🇸US 1, ss, ss://[email protected]:443/?plugin=obfs-local%3Bobfs%3Dtls%3Bobfs-host%3Dgateway-carry.icloud.com&group=Surgio#%F0%9F%87%BA%F0%9F%87%B8US%201␊
🇺🇸US 2, ss, ss://[email protected]:443/?group=Surgio#%F0%9F%87%BA%F0%9F%87%B8US%202␊
🇺🇲 US, ss, ss://[email protected]:443/?plugin=obfs-local%3Bobfs%3Dtls%3Bobfs-host%3Dgateway-carry.icloud.com&group=Surgio#%F0%9F%87%BA%F0%9F%87%B2%20US␊
🇺🇸US 1, ss, ss://[email protected]:443/?plugin=obfs-local%3Bobfs%3Dtls%3Bobfs-host%3Dgateway-carry.icloud.com&group=Surgio#%F0%9F%87%BA%F0%9F%87%B8US%201␊
🇺🇸US 2, ss, ss://[email protected]:444/?group=Surgio#%F0%9F%87%BA%F0%9F%87%B8US%202␊
🇺🇸US 3, ss, ss://[email protected]:445/?plugin=obfs-local%3Bobfs%3Dtls%3Bobfs-host%3Dwww.bing.com&group=Surgio#%F0%9F%87%BA%F0%9F%87%B8US%203␊
🇺🇸US 4, ss, ss://[email protected]:80/?plugin=obfs-local%3Bobfs%3Dhttp%3Bobfs-host%3Dwww.bing.com&group=Surgio#%F0%9F%87%BA%F0%9F%87%B8US%204␊
测试 1, vmess1, vmess1://[email protected]:8080/network=ws&tls=false␊
测试 2, vmess1, vmess1://[email protected]:8080/network=tcp&tls=false␊
ss1, ss, ss://Y2hhY2hhMjAtaWV0Zi1wb2x5MTMwNTpwYXNzd29yZA@server:443/?group=Surgio#ss1␊
ss2, ss, ss://Y2hhY2hhMjAtaWV0Zi1wb2x5MTMwNTpwYXNzd29yZA@server:443/?plugin=obfs-local%3Bobfs%3Dtls%3Bobfs-host%3Dwww.bing.com&group=Surgio#ss2␊
ss4, ss, ss://Y2hhY2hhMjAtaWV0Zi1wb2x5MTMwNTpwYXNzd29yZA@server:443/?plugin=obfs-local%3Bobfs%3Dtls%3Bobfs-host%3Dexample.com&group=Surgio#ss4`
测试 1, vmess1, vmess1://[email protected]:8080/?network=ws&tls=false␊
测试 2, vmess1, vmess1://[email protected]:8080/?network=tcp&tls=false`
Binary file modified test/snapshots/cli.test.ts.snap
Binary file not shown.

0 comments on commit 8ae0561

Please sign in to comment.