From 4703072db01b1bf99acf9ad76c916b861f42ba99 Mon Sep 17 00:00:00 2001 From: OPIran Official <130220895+opiran-club@users.noreply.github.com> Date: Sat, 17 Aug 2024 06:53:02 +0330 Subject: [PATCH] Update script.js --- script.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script.js b/script.js index 0909b68..74b33ac 100644 --- a/script.js +++ b/script.js @@ -1,4 +1,5 @@ function convertToURL() { + const name = document.getElementById('name').value; const address = document.getElementById('address').value; const port = document.getElementById('port').value; const secretKey = document.getElementById('secretKey').value; @@ -7,6 +8,6 @@ function convertToURL() { const peerSecretKey = document.getElementById('peerSecretKey').value; const peerPublicKey = document.getElementById('peerPublicKey').value; const allowedIPs = document.getElementById('allowedIPs').value; - const url = `wireguard://${encodeURIComponent(peerSecretKey)}@${address}:${port}/?publickey=${encodeURIComponent(peerPublicKey)}&address=${encodeURIComponent(allowedIPs)}&mtu=${encodeURIComponent(mtu)}`; + const url = `wireguard://${encodeURIComponent(peerSecretKey)}@${address}:${port}/?publickey=${encodeURIComponent(peerPublicKey)}&address=${encodeURIComponent(allowedIPs)}&mtu=${encodeURIComponent(mtu)#${encodeURIComponent(name)}`; document.getElementById('wg-uri').innerText = url; }