This commit is contained in:
parent
6f551540f0
commit
9c65fb2491
|
@ -98,7 +98,7 @@ function parseParams(paramsString?: string): Record<string, string> | undefined
|
|||
*/
|
||||
function createVlessLink({ uuid, host, port, params, name }: VlessLink): string {
|
||||
// 基本的 VLESS 链接格式
|
||||
let link = `vless://${uuid}@${host}:${port}\n`;
|
||||
let link = `vless://${uuid}@${host}:${port}`;
|
||||
|
||||
// 如果有查询参数,则拼接它们
|
||||
if (params && Object.keys(params).length > 0) {
|
||||
|
@ -111,7 +111,7 @@ function createVlessLink({ uuid, host, port, params, name }: VlessLink): string
|
|||
link += `#${encodeURIComponent(name)}`;
|
||||
}
|
||||
|
||||
return link;
|
||||
return link + '\n';
|
||||
}
|
||||
|
||||
export { CreatVmessDirect, ChangVmessServer, CreateLink, parseVlessLink }
|
||||
|
|
|
@ -67,7 +67,7 @@ const is_ip = (ip: string) => {
|
|||
return reg.test(ip);
|
||||
}
|
||||
function extractIPv4(ip: string): string | null {
|
||||
const ipv4Regex = /(\b25[0-5]\b|\b2[0-4][0-9]\b|\b[01]?[0-9][0-9]?\b)\.(\b25[0-5]\b|\b2[0-4][0-9]\b|\b[01]?[0-9][0-9]?\b)\.(\b25[0-5]\b|\b2[0-4][0-9]\b|\b[01]?[0-9][0-9]?\b)\.(\b25[0-5]\b|\b2[0-4][0-9]\b|\b[01]?[0-9][0-9]?\b)/g;
|
||||
const ipv4Regex = /(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)/;
|
||||
const matches = ip.match(ipv4Regex);
|
||||
|
||||
// 如果没有匹配到任何IPv4地址,返回 null
|
||||
|
|
|
@ -58,6 +58,7 @@ export default defineComponent({
|
|||
vless.port = props.serve.port
|
||||
if (props.serve.istls == 1 && vless.params) {
|
||||
vless.params.security = 'tls'
|
||||
vless.params.path = `/${ip}`
|
||||
}
|
||||
api.get_server_ms(props.serve.host, props.serve.port, ip, props.serve.istls).then((res) => {
|
||||
console.log(res)
|
||||
|
|
|
@ -60,6 +60,9 @@ export default defineComponent({
|
|||
|
||||
vless.name = props.names[index]
|
||||
vless.host = ip
|
||||
vless.port = 9000
|
||||
vless.params.path = '/'
|
||||
vless.params.security = 'none'
|
||||
api.get_server_ms(ip, 9000, ip, 0).then((res) => {
|
||||
console.log(res)
|
||||
time.value = res.time
|
||||
|
|
|
@ -24,6 +24,7 @@ import { CreateLink, CreatVmessDirect } from 'src/Util/Link';
|
|||
import { useQuasar } from 'quasar';
|
||||
import { vlessLink } from 'src/config';
|
||||
import { getdata } from 'src/api/api';
|
||||
import { VLESS } from 'src/Util/node/Vless';
|
||||
export default defineComponent({
|
||||
name: 'CreateLink',
|
||||
setup() {
|
||||
|
|
Loading…
Reference in New Issue