修复生成链接时不添加伪装域名和sni问题

This commit is contained in:
lingling 2024-12-10 20:24:19 +08:00
parent d7f4630047
commit a54e9402ac
4 changed files with 8 additions and 5 deletions

View File

@ -13,12 +13,13 @@ class getdata {
return tmp return tmp
} }
async get_country(ip: string) { async get_country(ip: string) {
let res = await api.post('https://api.giaogiao.uk/server/searchip', { const res = await api.post('https://api.giaogiao.uk/server/searchip', {
ip, ip,
}); });
res = res.data.country // res = res.data.country
if (typeof (res) == 'string') { return res } // if (typeof (res) == 'string') { return res }
return '' // console.log(res.data.data.country)
return res.data.data.country
} }
async get_server_ms(ip: string, port: number, to_ip: string, istls: number) { async get_server_ms(ip: string, port: number, to_ip: string, istls: number) {

View File

@ -59,6 +59,8 @@ export default defineComponent({
if (props.serve.istls == 1 && vless.params) { if (props.serve.istls == 1 && vless.params) {
vless.params.security = 'tls' vless.params.security = 'tls'
vless.params.path = `/${ip}` vless.params.path = `/${ip}`
vless.params.host = props.serve.host
vless.params.sni = props.serve.host
} }
api.get_server_ms(props.serve.host, props.serve.port, ip, props.serve.istls).then((res) => { api.get_server_ms(props.serve.host, props.serve.port, ip, props.serve.istls).then((res) => {
console.log(res) console.log(res)

View File

@ -58,7 +58,6 @@ export default defineComponent({
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
vless.params!.security = 'none' vless.params!.security = 'none'
api.get_server_ms(ip, 9000, '', 0).then((res) => { api.get_server_ms(ip, 9000, '', 0).then((res) => {
console.log(res)
time.value = res.time time.value = res.time
online.value = res.is_online online.value = res.is_online
}) })

View File

@ -46,6 +46,7 @@ export default defineComponent({
// outlink.value += await CreatVmessDirect(array[index]) // outlink.value += await CreatVmessDirect(array[index])
let vless = vlessLink let vless = vlessLink
let country = await api.get_country(array[index]) let country = await api.get_country(array[index])
console.log(country)
vless.name = country + array[index] vless.name = country + array[index]
vless.host = array[index] vless.host = array[index]
outlink.value += CreateLink('vless', vless) + '\n' outlink.value += CreateLink('vless', vless) + '\n'