-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
210 lines (199 loc) · 6.57 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<title>GitHub 代理</title>
<link rel="stylesheet" href="styles.css">
<meta charset="UTF-8">
<!-- Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-5N8GEQD9CY"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-5N8GEQD9CY');
</script>
<!-- LeanCloud -->
<script src="https://cdn.jsdelivr.net/npm/leancloud-storage@4.15.0/dist/av-min.js"></script>
</head>
<body>
<h1 class="title">GitHub 代理</h1>
<div id="results">
<div class="header">
<div class="logo">GitHub 代理</div>
<div class="header-buttons">
<a href="https://ghp.keleyaa.com/https://raw.githubusercontent.com/oopsunix/hosts/refs/heads/main/hosts_github"
class="hosts-btn"
target="_blank">
Hosts
</a>
<button class="reaction-btn">反馈</button>
</div>
</div>
<div class="input-group">
<input type="text" placeholder="请贴入来自 GitHub 的链接" />
<button class="download-btn">⚡️ 加速下载</button>
</div>
<div class="select-group">
<label>加速源:</label>
<select id="proxySelect">
<!-- 节点将通过 JavaScript 动态加载 -->
</select>
<button class="test-btn">在线节点检测</button>
<span id="testProgress" style="margin-left: 10px;"></span>
</div>
<div class="notice">
重要提示:公共服务,请勿滥用。加速源来自网络收集合,在此感谢每一位分享者。
<div id="userCount" style="margin-top: 10px;">
已有 <span id="visit-count">-</span> 名用户使用本工具
</div>
</div>
<div class="instructions">
<h2>使用说明</h2>
<ol>
<li>支持GitHub文件、Releases、archive、gist、raw.githubusercontent.com文件下载</li>
<li>复制 GitHub 文件的原始链接,粘贴到上方输入框</li>
<li>不支持整个项目文件夹的下载</li>
</ol>
<h2>页面合法输入示例</h2>
<ul>
<li>
<span class="label">原始文件:</span>
<a href="https://raw.githubusercontent.com/microsoft/vscode/main/LICENSE.txt" class="example-link">
https://raw.githubusercontent.com/microsoft/vscode/main/LICENSE.txt
</a>
</li>
<li>
<span class="label">版本来源:</span>
<a href="https://github.com/microsoft/vscode/archive/refs/heads/main.zip" class="example-link">
https://github.com/microsoft/vscode/archive/refs/heads/main.zip
</a>
</li>
<li>
<span class="label">发布文件:</span>
<a href="https://github.com/github/gh-ost/releases/download/v1.1.6/gh-ost" class="example-link">
https://github.com/github/gh-ost/releases/download/v1.1.6/gh-ost
</a>
</li>
<li>
<span class="label">发布源码:</span>
<a href="https://github.com/microsoft/vscode/archive/refs/tags/1.82.3.zip" class="example-link">
https://github.com/microsoft/vscode/archive/refs/tags/1.82.3.zip
</a>
</li>
</ul>
</div>
</div>
<div class="footer">
<div class="footer-content">
<div class="copyright">
© 2024 Eternity-sky. All rights reserved.
</div>
<a href="https://github.com/Eternity-Sky/Github_Proxy"
class="github-link"
target="_blank">
<span class="github-icon"></span>
GitHub 仓库
</a>
</div>
</div>
<script src="speedtest.js"></script>
<script>
// 定义代理节点列表
const proxyNodes = [
'gitproxy.click',
'ghp.arslantu.xyz',
'ghproxy.imciel.com',
'gh.monlor.com',
'gitproxy.mrhjx.cn',
'blfrp.cn',
'github.tmby.shop',
'gh.tryxd.cn',
'moran233.xyz',
'fastgit.cc',
'github.limoruirui.com',
'gh.jasonzeng.dev',
'git.speed-ssr.tech',
'gh-proxy.com',
'gh.xx9527.cn',
'gh.zwy.me',
'github.xxlab.tech',
'gh.idayer.com',
'gh.cache.cloudns.org',
'ghp.miaostay.com',
'ghpr.cc',
'github.7boe.top',
'gh.nxnow.top',
'hub.gitmirror.com',
'gh.pylas.xyz',
'gh-proxy.ygxz.in',
'gh.llkk.cc',
'gh.chaoyi996.com',
'ghp.ci',
'githubapi.jjchizha.com',
'gh-proxy.llyke.com',
'ql.133.info',
'ghproxy.cn',
'gh.6yit.com',
'ghp.keleyaa.com',
'ghproxy.net',
'ghproxy.xiaopa.cc',
'gh.xxooo.cf',
'ghproxy.cc',
'gh.catmak.name',
'git.669966.xyz',
'gh.api.99988866.xyz',
'gh.sixyin.com',
'proxy.yaoyaoling.net',
'gh.hlg.us.kg',
'ghproxy.cnproxy.top',
'git.40609891.xyz',
'github.ednovas.xyz',
'ghp.ml1.one',
'gp.zkitefly.eu.org',
'git.886.be',
'ghp.p3terx.com',
'gh.qninq.cn',
'cccccccccccccccccccccccccccccccccccccccccccccccccccc.cc',
'ghproxy.cianogame.top',
'ghproxy.1888866.xyz',
'mirror.ghproxy.com'
];
// 初始化下拉框选项
function initializeProxySelect() {
const select = document.getElementById('proxySelect');
select.innerHTML = proxyNodes.map(node => `
<option value="${node}">${node}</option>
`).join('');
}
window.onload = async () => {
// 首先初始化下拉框
initializeProxySelect();
// 然后进行速度测试
const results = await testAllNodes();
// 更新选择框的选项,包含延迟信息
const select = document.getElementById('proxySelect');
select.innerHTML = results.map(result => `
<option value="${result.node}">${result.node} - ${result.latency}ms</option>
`).join('');
};
document.addEventListener('click', (e) => {
if (e.target.classList.contains('test-btn')) {
testAllNodes().then(results => {
const select = document.getElementById('proxySelect');
select.innerHTML = results.map(result => `
<option value="${result.node}">${result.node} - ${result.latency}ms</option>
`).join('');
});
}
if (e.target.classList.contains('download-btn')) {
const input = document.querySelector('.input-group input');
const select = document.getElementById('proxySelect');
if (input.value && select.value) {
const proxyUrl = `https://${select.value}/${input.value}`;
window.open(proxyUrl);
}
}
});
</script>
</body>
</html>