-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.html
More file actions
362 lines (344 loc) · 18.8 KB
/
index.html
File metadata and controls
362 lines (344 loc) · 18.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Chain Proxy Builder</title>
<meta name="description"
content="Chain two proxy configs together — supports VLESS, VMess, Trojan, Shadowsocks, SOCKS, HTTP, SSH">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap"
rel="stylesheet">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="bg-glow bg-glow-1"></div>
<div class="bg-glow bg-glow-2"></div>
<div class="bg-glow bg-glow-3"></div>
<div class="container">
<!-- Header -->
<header class="header">
<div class="logo">
<span class="logo-icon">🔗</span>
<h1>Chain Proxy Builder</h1>
</div>
<p class="subtitle">Chain two proxy configs into Xray & Sing-box configurations</p>
<div class="protocol-badges">
<span class="badge badge-vless">VLESS</span>
<span class="badge badge-vmess">VMess</span>
<span class="badge badge-trojan">Trojan</span>
<span class="badge badge-ss">Shadowsocks</span>
<span class="badge badge-socks">SOCKS</span>
<span class="badge badge-http">HTTP</span>
<span class="badge badge-ssh">SSH <sup class="singbox-only-sup">sing-box</sup></span>
</div>
</header>
<!-- Config Inputs -->
<div class="configs-grid">
<!-- Config 1: Main Proxy -->
<div class="config-card" id="config1-card">
<div class="card-header">
<div class="card-title">
<span class="card-icon">1️⃣</span>
<div>
<h2>Config 1 — Main Proxy</h2>
<p class="card-hint">Any proxy config (this becomes the <code>proxy</code> outbound)</p>
</div>
</div>
<div class="card-header-right">
<button class="ssh-toggle" id="ssh-toggle1" title="Switch to SSH mode">
<span class="ssh-toggle-icon">🔑</span> SSH
</button>
<span class="protocol-tag" id="protocol1-tag">—</span>
</div>
</div>
<div class="input-group" id="url-input-group1">
<textarea id="config1-input" class="config-input"
placeholder="Paste proxy URL here... e.g. vless://uuid@address:port?params#remark"
spellcheck="false"></textarea>
<button class="btn-clear" id="clear1" title="Clear">✕</button>
</div>
<div class="ssh-form" id="ssh-form1" style="display:none;">
<div class="ssh-fields">
<div class="ssh-field">
<label for="ssh-server1">Server Address</label>
<input type="text" id="ssh-server1" placeholder="e.g. 1.2.3.4 or example.com"
spellcheck="false">
</div>
<div class="ssh-field ssh-field-small">
<label for="ssh-port1">Port</label>
<input type="number" id="ssh-port1" value="22" min="1" max="65535">
</div>
<div class="ssh-field">
<label for="ssh-user1">Username</label>
<input type="text" id="ssh-user1" placeholder="root" spellcheck="false">
</div>
<div class="ssh-field">
<label for="ssh-pass1">Password</label>
<div class="ssh-pass-wrapper">
<input type="password" id="ssh-pass1" placeholder="Enter password" spellcheck="false">
<button class="ssh-pass-toggle" data-target="ssh-pass1" title="Show/Hide">👁️</button>
</div>
</div>
</div>
<button class="btn-clear ssh-clear" id="ssh-clear1" title="Clear SSH fields">✕</button>
</div>
<div class="parsed-info" id="parsed1"></div>
</div>
<!-- Config 2: Chain Proxy -->
<div class="config-card" id="config2-card">
<div class="card-header">
<div class="card-title">
<span class="card-icon">2️⃣</span>
<div>
<h2>Config 2 — Chain Proxy</h2>
<p class="card-hint">External proxy to chain through (this becomes the <code>chain</code>
outbound)</p>
</div>
</div>
<div class="card-header-right">
<button class="ssh-toggle" id="ssh-toggle2" title="Switch to SSH mode">
<span class="ssh-toggle-icon">🔑</span> SSH
</button>
<span class="protocol-tag" id="protocol2-tag">—</span>
</div>
</div>
<div class="input-group" id="url-input-group2">
<textarea id="config2-input" class="config-input"
placeholder="Paste chain proxy URL here... e.g. vless://uuid@server:port?params#remark"
spellcheck="false"></textarea>
<button class="btn-clear" id="clear2" title="Clear">✕</button>
</div>
<div class="ssh-form" id="ssh-form2" style="display:none;">
<div class="ssh-fields">
<div class="ssh-field">
<label for="ssh-server2">Server Address</label>
<input type="text" id="ssh-server2" placeholder="e.g. 1.2.3.4 or example.com"
spellcheck="false">
</div>
<div class="ssh-field ssh-field-small">
<label for="ssh-port2">Port</label>
<input type="number" id="ssh-port2" value="22" min="1" max="65535">
</div>
<div class="ssh-field">
<label for="ssh-user2">Username</label>
<input type="text" id="ssh-user2" placeholder="root" spellcheck="false">
</div>
<div class="ssh-field">
<label for="ssh-pass2">Password</label>
<div class="ssh-pass-wrapper">
<input type="password" id="ssh-pass2" placeholder="Enter password" spellcheck="false">
<button class="ssh-pass-toggle" data-target="ssh-pass2" title="Show/Hide">👁️</button>
</div>
</div>
</div>
<button class="btn-clear ssh-clear" id="ssh-clear2" title="Clear SSH fields">✕</button>
</div>
<div class="parsed-info" id="parsed2"></div>
</div>
</div>
<!-- Chain Flow Visualization -->
<div class="chain-flow" id="chain-flow">
<div class="flow-node flow-you">
<span class="flow-emoji">💻</span>
<span>You</span>
</div>
<div class="flow-arrow">→</div>
<div class="flow-node flow-proxy" id="flow-proxy">
<span class="flow-emoji">☁️</span>
<span id="flow-proxy-label">Config 1</span>
</div>
<div class="flow-arrow">→</div>
<div class="flow-node flow-chain" id="flow-chain">
<span class="flow-emoji">🔗</span>
<span id="flow-chain-label">Config 2</span>
</div>
<div class="flow-arrow">→</div>
<div class="flow-node flow-target">
<span class="flow-emoji">🌐</span>
<span>Internet</span>
</div>
</div>
<!-- Settings -->
<div class="settings-card">
<h3 class="settings-title">⚙️ Configuration Options</h3>
<div class="settings-grid">
<div class="setting-item">
<label for="dns-server">Remote DNS</label>
<select id="dns-server">
<option value="https://8.8.8.8/dns-query">Google DoH (8.8.8.8)</option>
<option value="https://dns.google/dns-query">Google DoH (dns.google)</option>
<option value="https://dns.adguard-dns.com/dns-query">AdGuard DoH</option>
<option value="https://dns.quad9.net/dns-query">Quad9 DoH</option>
</select>
</div>
<div class="setting-item">
<label for="socks-port">SOCKS Port</label>
<input type="number" id="socks-port" value="10808" min="1" max="65535">
</div>
<div class="setting-item">
<label for="log-level">Log Level</label>
<select id="log-level">
<option value="none">None</option>
<option value="warning" selected>Warning</option>
<option value="error">Error</option>
<option value="info">Info</option>
<option value="debug">Debug</option>
</select>
</div>
</div>
</div>
<!-- Generate Button -->
<div class="generate-section">
<button class="btn-generate" id="btn-generate" disabled>
<span class="btn-icon">⚡</span>
Generate Chained Config
</button>
<p class="generate-hint" id="generate-hint">Paste both configs above to enable</p>
</div>
<!-- Output -->
<div class="output-section" id="output-section" style="display:none;">
<!-- Output Tabs -->
<div class="output-tabs">
<button class="output-tab active" id="tab-xray" data-tab="xray">
<span class="tab-icon">⚡</span> Xray
</button>
<button class="output-tab" id="tab-singbox" data-tab="singbox">
<span class="tab-icon">📦</span> Sing-box
</button>
</div>
<!-- Xray Output -->
<div class="output-panel active" id="panel-xray" data-panel="xray">
<div class="output-header">
<h3>📋 Xray Configuration</h3>
<div class="output-actions">
<button class="btn-copy" id="btn-copy-xray" title="Copy to clipboard">
<span class="copy-icon">📋</span> Copy
</button>
<button class="btn-download" id="btn-download-xray" title="Download as JSON">
<span class="download-icon">💾</span> Download
</button>
</div>
</div>
<div class="output-remark" id="output-remark-xray"></div>
<pre class="output-code"><code id="output-json-xray"></code></pre>
</div>
<!-- Sing-box Output -->
<div class="output-panel" id="panel-singbox" data-panel="singbox">
<!-- Sub Tabs for Sing-box -->
<div class="sub-tabs">
<button class="sub-tab active" data-subtab="singbox-standard">
Standard
</button>
<button class="sub-tab" data-subtab="singbox-nekoray">
Nekoray
</button>
<button class="sub-tab" data-subtab="singbox-nekobox">
Nekobox
</button>
</div>
<!-- Sub Panel: Standard -->
<div class="sub-panel active" id="subpanel-singbox-standard">
<div class="output-header">
<h3>📋 Sing-box Configuration</h3>
<div class="output-actions">
<button class="btn-copy" id="btn-copy-singbox" title="Copy to clipboard">
<span class="copy-icon">📋</span> Copy
</button>
<button class="btn-download" id="btn-download-singbox" title="Download as JSON">
<span class="download-icon">💾</span> Download
</button>
</div>
</div>
<div class="output-remark" id="output-remark-singbox"></div>
<pre class="output-code"><code id="output-json-singbox"></code></pre>
</div>
<!-- Sub Panel: Nekoray -->
<div class="sub-panel" id="subpanel-singbox-nekoray">
<div class="output-header">
<h3>📋 Nekoray Configuration</h3>
<div class="output-actions">
<button class="btn-copy" id="btn-copy-singbox-client" title="Copy to clipboard">
<span class="copy-icon">📋</span> Copy
</button>
<button class="btn-download" id="btn-download-singbox-client" title="Download as JSON">
<span class="download-icon">💾</span> Download
</button>
</div>
</div>
<div class="output-remark" id="output-remark-singbox-client"></div>
<pre class="output-code"><code id="output-json-singbox-client"></code></pre>
</div>
<!-- Sub Panel: Nekobox -->
<div class="sub-panel" id="subpanel-singbox-nekobox">
<div class="output-header">
<h3>📋 Nekobox Configuration</h3>
<div class="output-actions">
<button class="btn-copy" id="btn-copy-nekobox" title="Copy to clipboard">
<span class="copy-icon">📋</span> Copy
</button>
<button class="btn-download" id="btn-download-nekobox" title="Download as JSON">
<span class="download-icon">💾</span> Download
</button>
</div>
</div>
<div class="output-remark" id="output-remark-nekobox"></div>
<pre class="output-code"><code id="output-json-nekobox"></code></pre>
</div>
</div>
</div>
<!-- Info -->
<details class="info-section">
<summary>ℹ️ How Chain Proxy Works</summary>
<div class="info-content">
<p>A <strong>chain proxy</strong> routes your traffic through two proxies in sequence:</p>
<div class="info-flow">
<code>You → Config 1 (Worker/CDN) → Config 2 (Chain) → Internet</code>
</div>
<p>This fixes your outgoing IP address to the chain proxy's IP, ensuring a consistent IP for all
destinations.</p>
<h4>Supported Protocols</h4>
<ul>
<li><strong>VLESS</strong> — <code>vless://uuid@server:port?params</code></li>
<li><strong>VMess</strong> — <code>vmess://base64-json</code></li>
<li><strong>Trojan</strong> — <code>trojan://password@server:port?params</code></li>
<li><strong>Shadowsocks</strong> — <code>ss://base64(method:pass)@server:port</code></li>
<li><strong>SOCKS</strong> — <code>socks://user:pass@server:port</code></li>
<li><strong>HTTP</strong> — <code>http://user:pass@server:port</code></li>
<li><strong>SSH</strong> — <em>Sing-box only</em> (4-field input: server, port, username, password)
</li>
</ul>
<h4>Output Formats</h4>
<ul>
<li><strong>Xray JSON</strong> — Use with any Xray-compatible client (v2rayN, v2rayNG, Nekoray,
etc.)</li>
<li><strong>Sing-box JSON</strong> — Use with <a href="https://sing-box.sagernet.org/"
target="_blank">sing-box</a> client</li>
</ul>
<h4>Supported Transports</h4>
<p>TCP, TCP (http header), WebSocket, gRPC, HTTPUpgrade</p>
<h4>Supported TLS</h4>
<p>TLS, Reality, None</p>
<h4>⚠️ Important Notes</h4>
<ul>
<li><strong>SOCKS & HTTP</strong> configs must include <strong>username and password</strong>.</li>
<li><strong>Xray</strong> does not support <strong>raw</strong> (headerless TCP) configs.</li>
<li><strong>Shadowsocks</strong> cannot have any transport (WebSocket, gRPC, etc.) and cannot have
TLS.</li>
<li><strong>SSH</strong> is only supported by <a href="https://sing-box.sagernet.org/"
target="_blank">Sing-box</a> — Xray tab is disabled when SSH is used.</li>
</ul>
</div>
</details>
<footer class="footer">
<p>Project Repository: <a href="https://github.com/Hidden-Node/proxy-builder"
target="_blank">Hidden-Node/proxy-builder</a></p>
<p>Based on <a href="https://github.com/bia-pain-bache/BPB-Worker-Panel"
target="_blank">BPB-Worker-Panel</a> chain proxy logic</p>
</footer>
</div>
<script src="script.js"></script>
</body>
</html>