@@ -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) => {
123124const generateWireGuardConfig = ( data , privateKey , endpoint ) => `
124125[Interface]
125126PrivateKey = ${ 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
128129MTU = 1280
129130
130131[Peer]
131132PublicKey = ${ data . config . peers [ 0 ] . public_key }
132- AllowedIPs = 0.0.0.0/0
133+ AllowedIPs = 0.0.0.0/0, ::/0
133134Endpoint = ${ 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
150151const updateDOM = ( container , title , textareaId , content , messageId ) => {
0 commit comments