-
Notifications
You must be signed in to change notification settings - Fork 26
/
install.html
93 lines (89 loc) · 2.7 KB
/
install.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
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<!--meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /-->
<meta name="viewport" content="width=device-width" />
<title>Siri Proxy Installer</title>
<style type="text/css">
body{
background:#000;
color:#ccc;
}
.success {
color:green;
}
.fail {
color:red;
}
</style>
</head>
<body>
<pre id="message"></pre>
<script type="text/javascript">
function ping(url, callback){
var img = new Image();
img.onload = function(){
img = null;
callback(true);
};
img.onerror = function(){
img = null;
callback(false);
}
img.src = url + "?r=" + +new Date;
}
(function(list){
function $(id){
return document.getElementById(id);
}
function update(){
$("message").innerHTML = message.join("");
}
var message = [], index = 0, count = list.length;
function check(){
var item = list[index];
message.push("<span class=\"msg\">", item.msg, "</span>");
item.check(function(success){
message.push("\t",success ? "<strong class=\"stat success\">[OK]</strong>" : "<strong class=\"stat fail\">[FAIL]</strong>", "</strong><br />");
if(success && item.ok)
message.push("<span class=\"info\">", item.ok, "</span><br />");
if(!success && item.err)
message.push("<span class=\"info\">", item.err, "</span><br />");
update();
if(success && ++index < count){
check();
}
});
update();
}
check();
})([
{
"msg":"Checking DNS<br />检测DNS解析",
"err":"Check entry for guzzoni.apple.com !<br />请确保 guzzoni.apple.com 域名被解析到代理服务器",
"check":function(callback){
ping("http://guzzoni.apple.com/ping.gif", callback);
}
},{
"msg":"Starting HTTPS-Service<br />启动HTTPS服务",
"check":function(callback){
ping("http://guzzoni.apple.com/https.gif", callback);
}
},{
"msg":"Checking HTTPS cert<br />检测HTTPS证书",
"err":"Please install cert from <a href=\"ca\">here</a>.<br />HTTPS连接失败,如未安装证书,请<a href=\"ca\">点此安装</a>.",
"check":function(callback){
ping("https://guzzoni.apple.com/ping.gif", callback);
}
},{
"msg":"Starting Siri-Service<br />启动Siri代理服务",
"ok":"Server running!<br />请对Siri说“你好”,<br />代理服务器将回应“Siri代理向你问好”",
"check":function(callback){
ping("http://guzzoni.apple.com/siri.gif", callback);
}
}
]);
</script>
</body>
</html>