Skip to content

Commit

Permalink
Update script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
opiran-club authored Aug 17, 2024
1 parent 3fcf2b6 commit 4703072
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
}

0 comments on commit 4703072

Please sign in to comment.