mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2026-04-05 00:23:15 +08:00
fix (core): Clash Vmess servername does parse correctly
This commit is contained in:
@@ -281,7 +281,30 @@ function Clash_All() {
|
||||
}
|
||||
return true;
|
||||
};
|
||||
const parse = (line) => JSON.parse(line);
|
||||
const parse = (line) => {
|
||||
const proxy = JSON.parse(line);
|
||||
if (
|
||||
![
|
||||
'ss',
|
||||
'ssr',
|
||||
'vmess',
|
||||
'socks',
|
||||
'http',
|
||||
'snell',
|
||||
'trojan',
|
||||
].includes(proxy.type)
|
||||
) {
|
||||
throw new Error(
|
||||
`Clash does not support proxy with type: ${proxy.type}`,
|
||||
);
|
||||
}
|
||||
|
||||
// handle vmess sni
|
||||
proxy.sni = proxy.servername;
|
||||
delete proxy.servername;
|
||||
|
||||
return proxy;
|
||||
};
|
||||
return { name, test, parse };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user