Update index.js

This commit is contained in:
Yu Steven authored and GitHub committed 2022-07-11 19:29:56 +08:00
1 parent 8c4a7d985f
commit 1912f997f2
1 file changed
+15 -10
+15 -10
View File
@@ -91,32 +91,37 @@ async function run(){
case 'vmess': case 'vmess':
try{ try{
item.data.ps = (name).toString(); item.data.ps = (name).toString();
urlCountryList[finalList[i].country].push('vmess://'+Buffer.from(JSON.stringify(item.data),'utf8').toString('base64'))}catch(e){ urlCountryList[finalList[i].country].push('vmess://'+Buffer.from(JSON.stringify(item.data),'utf8').toString('base64'))
console.log('err') }catch(e){
console.log('vmess node err')
} }
break break
case 'trojan': case 'trojan':
try{ try{
urlCountryList[finalList[i].country].push('trojan://'+item.data+'#'+(name).toString())}catch(e){ urlCountryList[finalList[i].country].push('trojan://'+item.data+'#'+(name).toString())
console.log('err') }catch(e){
console.log('trojan node err')
} }
break break
case 'ss': case 'ss':
try{ try{
urlCountryList[finalList[i].country].push('ss://'+item.data+'#'+(name).toString())}catch(e){ urlCountryList[finalList[i].country].push('ss://'+item.data+'#'+(name).toString())
console.log('err') }catch(e){
console.log('ss node err')
} }
break break
case 'ssr': case 'ssr':
try{ try{
urlCountryList[finalList[i].country].push('ssr://'+Buffer.from(item.data.replace('{name}',Buffer.from((name).toString(),'utf8').toString('base64')),'utf8').toString('base64'))}catch(e){ urlCountryList[finalList[i].country].push('ssr://'+Buffer.from(item.data.replace('{name}',Buffer.from((name).toString(),'utf8').toString('base64')),'utf8').toString('base64'))
console.log('err') }catch(e){
console.log('ssr node err')
} }
break break
case 'https': case 'https':
try{ try{
urlCountryList[finalList[i].country].push('https://'+item.data+'#'+encodeURIComponent(name.toString()))}catch(e){ urlCountryList[finalList[i].country].push('https://'+item.data+'#'+encodeURIComponent(name.toString()))
console.log('err') }catch(e){
console.log('https node err')
} }
break break
default: default: