Skip to content

Commit 100e99e

Browse files
authored
Update index.html
1 parent be26a2e commit 100e99e

File tree

1 file changed

+130
-139
lines changed

1 file changed

+130
-139
lines changed

index.html

Lines changed: 130 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -5,125 +5,124 @@
55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<title>Random Config</title>
8-
<style>
8+
<style>
9+
a {
10+
color: inherit;
11+
text-decoration: none;
12+
}
913

10-
a {
11-
color: inherit;
12-
text-decoration: none;
13-
}
14+
a:hover {
15+
color: #ffffff;
16+
text-decoration: underline;
17+
}
1418

15-
a:hover {
16-
color: #ffffff;
17-
text-decoration: underline;
18-
}
19+
a:visited {
20+
color: #ffffff;
21+
}
1922

20-
a:visited {
21-
color: #ffffff;
22-
}
23+
a:active {
24+
color: #ffffff;
25+
}
2326

24-
a:active {
25-
color: #ffffff;
26-
}
27+
a:focus {
28+
outline: 2px solid #007bff;
29+
}
2730

28-
a:focus {
29-
outline: 2px solid #007bff;
30-
}
31-
32-
body {
33-
background-color: #121212;
34-
color: #ffffff;
35-
text-align: center;
36-
margin-top: 50px;
37-
font-family: Arial, sans-serif;
38-
}
31+
body {
32+
background-color: #121212;
33+
color: #ffffff;
34+
text-align: center;
35+
margin-top: 50px;
36+
font-family: Arial, sans-serif;
37+
}
3938

40-
.container {
41-
background-color: #1e1e1e;
42-
border-radius: 10px;
43-
padding: 30px;
44-
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
45-
max-width: 800px;
46-
margin: auto;
47-
}
39+
.container {
40+
background-color: #1e1e1e;
41+
border-radius: 10px;
42+
padding: 30px;
43+
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
44+
max-width: 800px;
45+
margin: auto;
46+
}
4847

49-
textarea {
50-
margin-top: 20px;
51-
width: 100%;
52-
height: 400px;
53-
font-size: 16px;
54-
resize: none;
55-
background-color: #2a2a2a;
56-
color: #ffffff;
57-
border: none;
58-
border-radius: 5px;
59-
padding: 10px;
60-
overflow-y: auto;
61-
}
48+
textarea {
49+
margin-top: 20px;
50+
width: 100%;
51+
height: 400px;
52+
font-size: 16px;
53+
resize: none;
54+
background-color: #2a2a2a;
55+
color: #ffffff;
56+
border: none;
57+
border-radius: 5px;
58+
padding: 10px;
59+
overflow-y: auto;
60+
}
6261

63-
textarea::-webkit-scrollbar {
64-
width: 8px;
65-
}
62+
textarea::-webkit-scrollbar {
63+
width: 8px;
64+
}
6665

67-
textarea::-webkit-scrollbar-track {
68-
background: #1e1e1e;
69-
border-radius: 5px;
70-
}
66+
textarea::-webkit-scrollbar-track {
67+
background: #1e1e1e;
68+
border-radius: 5px;
69+
}
7170

72-
textarea::-webkit-scrollbar-thumb {
73-
background: #007bff;
74-
border-radius: 5px;
75-
}
71+
textarea::-webkit-scrollbar-thumb {
72+
background: #007bff;
73+
border-radius: 5px;
74+
}
7675

77-
textarea::-webkit-scrollbar-thumb:hover {
78-
background: #0056b3;
79-
}
76+
textarea::-webkit-scrollbar-thumb:hover {
77+
background: #0056b3;
78+
}
8079

81-
button {
82-
margin-top: 10px;
83-
padding: 10px 20px;
84-
font-size: 16px;
85-
color: #ffffff;
86-
background-color: #007bff;
87-
border: none;
88-
border-radius: 5px;
89-
cursor: pointer;
90-
}
80+
button {
81+
margin-top: 10px;
82+
padding: 10px 20px;
83+
font-size: 16px;
84+
color: #ffffff;
85+
background-color: #007bff;
86+
border: none;
87+
border-radius: 5px;
88+
cursor: pointer;
89+
}
9190

92-
button:hover {
93-
background-color: #0056b3;
94-
}
91+
button:hover {
92+
background-color: #0056b3;
93+
}
9594

96-
.form-group input,
97-
.form-group input:focus {
98-
width: 100%;
99-
padding: 10px;
100-
font-size: 16px;
101-
border: none;
102-
border-radius: 5px;
103-
background-color: #2a2a2a;
104-
color: #ffffff;
105-
}
95+
.form-group input,
96+
.form-group input:focus {
97+
width: 100%;
98+
padding: 10px;
99+
font-size: 16px;
100+
border: none;
101+
border-radius: 5px;
102+
background-color: #2a2a2a;
103+
color: #ffffff;
104+
}
106105

107-
.form-label {
108-
margin-top: 20px;
109-
}
106+
.form-label {
107+
margin-top: 20px;
108+
}
110109

111-
.form-range {
112-
margin-top: 20px;
113-
width: 100%;
114-
}
115-
</style>
110+
.form-range {
111+
margin-top: 20px;
112+
width: 100%;
113+
}
114+
</style>
116115
</head>
117116

118117
<body>
119-
<div class="container">
120-
<h1 class="mb-4"><a href="https://github.com/GFW4Fun/xray_bulk_config_with_random_cdn_ip_range">🔗Bulk Config With Random IP Range</a></h1>
121-
<div class="form-group">
122-
<input type="text" id="inputConfig" placeholder="Enter a config of vless/vmess/trojan/wireguard here..." />
123-
</div>
118+
<div class="container">
119+
<h1 class="mb-4"><a href="https://github.com/GFW4Fun/xray_bulk_config_with_random_cdn_ip_range">🔗Bulk Config With Random IP Range</a></h1>
120+
<div class="form-group">
121+
<input type="text" id="inputConfig" placeholder="Enter a config of vless/vmess/trojan/wireguard here..." />
122+
</div>
124123
<br />
125-
<label for="ipranges" class="form-label mt-3">CIDR IP Ranges (Default Cloudflare Range):</label>
126-
<textarea id="ipranges" placeholder="Enter CIDR ranges here...">173.245.48.0/20
124+
<label for="ipranges" class="form-label mt-3">CIDR IP Ranges (Default Cloudflare Range):</label>
125+
<textarea id="ipranges" placeholder="Enter CIDR ranges here...">173.245.48.0/20
127126
103.21.244.0/22
128127
103.22.200.0/22
129128
103.31.4.0/22
@@ -138,26 +137,27 @@ <h1 class="mb-4"><a href="https://github.com/GFW4Fun/xray_bulk_config_with_rando
138137
104.24.0.0/14
139138
172.64.0.0/13
140139
131.0.72.0/22</textarea>
141-
<textarea id="result" placeholder="Result..." readonly></textarea>
142-
<input type="range" class="form-range" min="10" max="1000000" step="1" id="outputCount" value="1000" oninput="updateOutputCountValue()">
143-
<button id="generateButton" onclick="pickRandomIPs()">⚙️Generate Random Config (1000)</button>
144-
<button id="copyToClipboard" onclick="copyToClipboard()">📋Copy Result to Clipboard</button>
145-
<br> <br><hr>
146-
<h3 class="mb-4">Paste > V2rayN > Ctrl+A > Ctrl+R > Sort by result!</h3>
147-
</div>
140+
<textarea id="result" placeholder="Result..." readonly></textarea>
141+
<input type="range" class="form-range" min="10" max="1000000" step="1" id="outputCount" value="1000" oninput="updateOutputCountValue()">
142+
<button id="generateButton" onclick="pickRandomIPs()">⚙️Generate Random Config (1000)</button>
143+
<button id="copyToClipboard" onclick="copyToClipboard()">📋Copy Result to Clipboard</button>
144+
<br> <br>
145+
<hr>
146+
<h3 class="mb-4">Paste > V2rayN > Ctrl+A > Ctrl+R > Sort by result!</h3>
147+
</div>
148148
<script>
149149
function updateOutputCountValue() {
150150
const count = document.getElementById('outputCount').value;
151151
document.getElementById('generateButton').innerText = `⚙️Generate Random Config (${count})`;
152152
}
153153

154-
function detectConfigType(inputConfig) {
155-
if(inputConfig.startsWith('vmess://')) return 'vmess';
156-
if(inputConfig.startsWith('vless://')) return 'vless';
157-
if(inputConfig.startsWith('wireguard://')) return 'wireguard';
158-
if(inputConfig.startsWith('trojan://')) return 'trojan';
159-
return 'unknown';
160-
}
154+
function detectConfigType(inputConfig) {
155+
if(inputConfig.startsWith('vmess://')) return 'vmess';
156+
if(inputConfig.startsWith('vless://')) return 'vless';
157+
if(inputConfig.startsWith('wireguard://')) return 'wireguard';
158+
if(inputConfig.startsWith('trojan://')) return 'trojan';
159+
return 'unknown';
160+
}
161161

162162
function replaceIPInConfig(inputConfig, ipOrAddress) {
163163
const configType = detectConfigType(inputConfig);
@@ -169,30 +169,19 @@ <h3 class="mb-4">Paste > V2rayN > Ctrl+A > Ctrl+R > Sort by result!</h3>
169169
wireguard: /^(wireguard:\/\/[^@]+@)[^:]+(:.+)$/,
170170
trojan: /^(trojan:\/\/[^@]+@)[^:]+(:.+)$/
171171
};
172-
173-
function getSNI(config) {
174-
if (config.sni && config.sni.trim() !== "") {
175-
return config.sni;
176-
} else {
177-
return config.add;
178-
}
179-
}
180-
181172
switch (configType) {
182173
case 'vmess':
183174
const vmessMatch = inputConfig.match(regexPatterns.vmess);
184175
if(vmessMatch) {
185176
const vmessConfig = JSON.parse(atob(vmessMatch[1]));
186177
vmessConfig.add = addressStr;
187-
vmessConfig.sni = getSNI(vmessConfig);
188178
result = `vmess://${btoa(JSON.stringify(vmessConfig))}\n\n`;
189179
}
190180
break;
191181
case 'vless':
192182
const vlessMatch = inputConfig.match(regexPatterns.vless);
193183
if(vlessMatch) {
194-
const sni = vlessMatch[2] || vlessMatch[1].split('@')[1];
195-
result = `${vlessMatch[1]}@${addressStr}${vlessMatch[3]};sni=${sni}\n\n`;
184+
result = `${vlessMatch[1]}@${addressStr}${vlessMatch[3]}\n\n`;
196185
}
197186
break;
198187
case 'wireguard':
@@ -204,8 +193,7 @@ <h3 class="mb-4">Paste > V2rayN > Ctrl+A > Ctrl+R > Sort by result!</h3>
204193
case 'trojan':
205194
const trojanMatch = inputConfig.match(regexPatterns.trojan);
206195
if(trojanMatch) {
207-
const sni = trojanMatch[2] || trojanMatch[1].split('@')[1];
208-
result = `${trojanMatch[1]}${addressStr}${trojanMatch[2]};sni=${sni}\n\n`;
196+
result = `${trojanMatch[1]}${addressStr}${trojanMatch[2]}\n\n`;
209197
}
210198
break;
211199
default:
@@ -250,8 +238,10 @@ <h3 class="mb-4">Paste > V2rayN > Ctrl+A > Ctrl+R > Sort by result!</h3>
250238
const cidrListText = document.getElementById('ipranges').value;
251239
const cidrList = cidrListText.split('\n').filter(line => line.trim() !== '');
252240
const ipList = generateIPList(cidrList);
253-
if (detectConfigType(inputConfig) === 'unknown' || cidrList.length === 0)
254-
{alert("No/bad config/range!\nEnter valid config/range.");return;}
241+
if(detectConfigType(inputConfig) === 'unknown' || cidrList.length === 0) {
242+
alert("No/bad config/range!\nEnter valid config/range.");
243+
return;
244+
}
255245
let results = new Array(count);
256246
for(let i = 0; i < count; i++) {
257247
const randomIndex = Math.floor(Math.random() * ipList.length);
@@ -260,16 +250,17 @@ <h3 class="mb-4">Paste > V2rayN > Ctrl+A > Ctrl+R > Sort by result!</h3>
260250
}
261251
resultTextarea.value = results.join('');
262252
}
263-
function copyToClipboard() {
264-
const copyText = document.getElementById("result");
265-
if (copyText.value.length !== 0) {
266-
copyText.select();
267-
document.execCommand("copy");
268-
alert("Copied the result!");
269-
} else {
270-
alert("Result is empty!");
271-
}
272-
}
253+
254+
function copyToClipboard() {
255+
const copyText = document.getElementById("result");
256+
if(copyText.value.length !== 0) {
257+
copyText.select();
258+
document.execCommand("copy");
259+
alert("Copied the result!");
260+
} else {
261+
alert("Result is empty!");
262+
}
263+
}
273264
</script>
274265
</body>
275266

0 commit comments

Comments
 (0)