Skip to content

Commit 2e4cfa3

Browse files
committed
update app.js
1 parent 6232a48 commit 2e4cfa3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

js/app.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ const generateConfig = async (data, privateKey) => {
106106
privateKey,
107107
data.config.peers[0].public_key,
108108
data.config.interface.addresses.v4,
109+
data.config.interface.addresses.v6,
109110
reserved,
110111
endpoint
111112
);
@@ -123,13 +124,13 @@ const generateConfig = async (data, privateKey) => {
123124
const generateWireGuardConfig = (data, privateKey, endpoint) => `
124125
[Interface]
125126
PrivateKey = ${privateKey}
126-
Address = ${data.config.interface.addresses.v4}/32
127-
DNS = 1.1.1.1, 1.0.0.1
127+
Address = ${data.config.interface.addresses.v4}/32, ${data.config.interface.addresses.v6}/128
128+
DNS = 1.1.1.1, 1.0.0.1, 2606:4700:4700::1111, 2606:4700:4700::1001
128129
MTU = 1280
129130
130131
[Peer]
131132
PublicKey = ${data.config.peers[0].public_key}
132-
AllowedIPs = 0.0.0.0/0
133+
AllowedIPs = 0.0.0.0/0, ::/0
133134
Endpoint = ${endpoint}
134135
`;
135136

@@ -141,10 +142,10 @@ const generateReserved = (clientId) =>
141142
.join('%2C');
142143

143144
// Generate V2Ray URL
144-
const generateV2RayURL = (privateKey, publicKey, ipv4, reserved, endpoint) =>
145+
const generateV2RayURL = (privateKey, publicKey, ipv4, ipv6, reserved, endpoint) =>
145146
`wireguard://${encodeURIComponent(privateKey)}@${endpoint}?address=${encodeURIComponent(
146147
ipv4 + '/32'
147-
)}&reserved=${reserved}&publickey=${encodeURIComponent(publicKey)}&mtu=1420#V2ray-Config`;
148+
)},${encodeURIComponent(ipv6 + '/128')}&reserved=${reserved}&publickey=${encodeURIComponent(publicKey)}&mtu=1420#V2ray-Config`;
148149

149150
// Update DOM with Configurations
150151
const updateDOM = (container, title, textareaId, content, messageId) => {

0 commit comments

Comments
 (0)