forked from iLayPark/PortForwardGo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
static.go
186 lines (166 loc) · 9.51 KB
/
static.go
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
package main
import (
"strconv"
)
const Page503 = `<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>503 Service Unavailable</title>
<style>
a {
color: black;
text-decoration: none;
color: olive;
}
.card {
width: 35em;
margin: 64px auto;
opacity: 0.87;
padding: 24px 32px;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12);
border-radius: 2px;
background: white;
margin-bottom: 8px;
position: relative;
}
.node {
position: absolute;
top: 16px;
right: 24px;
opacity: 0.68;
font-size: 48px;
font-weight: 400;
}
</style>
<style></style></head>
<body style="font-family: 'Microsoft YaHei';background: rgb(241, 241, 241);">
<div class="card">
<h1 style="margin: 0">503 Service Unavailable</h1>
<p>您访问的网站或服务暂时不可用</p>
<p>如果您是网站所有者,请检查:</p>
<ul>
<li>域名解析配置是否正确</li>
<li>流量是否已用尽</li>
<li>规则是否状态正常</li>
</ul>
<p>如果您是一般访问者, 您可以:</p>
<ul>
<li>尝试联系网站所有者</li>
<li>稍等一段时间再尝试访问</li>
<li><a href="https://jingyan.baidu.com/article/6d704a13fb6e1828db51ca3a.html" target="_blank">刷新您的 DNS 缓存</a> 或 更换网络环境访问</li>
</ul>
<div>
<p style="float: right; margin: 0">Powered by <a href="https://github.com/CoiaPrant/PortForwardGo">PortForwardGo</a></p>
</div>
</div>
<div style="position: static; width: 0px; height: 0px; border: none; padding: 0px; margin: 0px;"><div id="trans-tooltip"><div id="tip-left-top" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-left-top.png");"></div><div id="tip-top" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-top.png") repeat-x;"></div><div id="tip-right-top" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-right-top.png");"></div><div id="tip-right" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-right.png") repeat-y;"></div><div id="tip-right-bottom" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-right-bottom.png");"></div><div id="tip-bottom" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-bottom.png") repeat-x;"></div><div id="tip-left-bottom" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-left-bottom.png");"></div><div id="tip-left" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-left.png");"></div><div id="trans-content"></div></div><div id="tip-arrow-bottom" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-arrow-bottom.png");"></div><div id="tip-arrow-top" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-arrow-top.png");"></div></div></body></html>
`
const Page522 = `<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>522 Connection timed out</title>
<style>
a {
color: black;
text-decoration: none;
color: olive;
}
.card {
width: 35em;
margin: 64px auto;
opacity: 0.87;
padding: 24px 32px;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12);
border-radius: 2px;
background: white;
margin-bottom: 8px;
position: relative;
}
.node {
position: absolute;
top: 16px;
right: 24px;
opacity: 0.68;
font-size: 48px;
font-weight: 400;
}
</style>
<style></style></head>
<body style="font-family: 'Microsoft YaHei';background: rgb(241, 241, 241);">
<div class="card">
<h1 style="margin: 0">522 Connection timed out</h1>
<p>您访问的网站或服务暂时不可用</p>
<p>如果您是网站所有者,请检查:</p>
<ul>
<li>域名解析配置是否正确</li>
<li>源站Web是否正常运行</li>
<li>防火墙配置是否正确<li>
</ul>
<p>如果您是一般访问者, 您可以:</p>
<ul>
<li>尝试联系网站所有者</li>
<li>稍等一段时间再尝试访问</li>
<li><a href="https://jingyan.baidu.com/article/6d704a13fb6e1828db51ca3a.html" target="_blank">刷新您的 DNS 缓存</a> 或 更换网络环境访问</li>
</ul>
<div>
<p style="float: right; margin: 0">Powered by <a href="https://github.com/CoiaPrant/PortForwardGo">PortForwardGo</a></p>
</div>
</div>
<div style="position: static; width: 0px; height: 0px; border: none; padding: 0px; margin: 0px;"><div id="trans-tooltip"><div id="tip-left-top" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-left-top.png");"></div><div id="tip-top" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-top.png") repeat-x;"></div><div id="tip-right-top" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-right-top.png");"></div><div id="tip-right" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-right.png") repeat-y;"></div><div id="tip-right-bottom" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-right-bottom.png");"></div><div id="tip-bottom" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-bottom.png") repeat-x;"></div><div id="tip-left-bottom" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-left-bottom.png");"></div><div id="tip-left" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-left.png");"></div><div id="trans-content"></div></div><div id="tip-arrow-bottom" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-arrow-bottom.png");"></div><div id="tip-arrow-top" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-arrow-top.png");"></div></div></body></html>
`
const Page404 = `<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>404 Not Found</title>
<style>
a {
color: black;
text-decoration: none;
color: olive;
}
.card {
width: 35em;
margin: 64px auto;
opacity: 0.87;
padding: 24px 32px;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12);
border-radius: 2px;
background: white;
margin-bottom: 8px;
position: relative;
}
.node {
position: absolute;
top: 16px;
right: 24px;
opacity: 0.68;
font-size: 48px;
font-weight: 400;
}
</style>
<style></style></head>
<body style="font-family: 'Microsoft YaHei';background: rgb(241, 241, 241);">
<div class="card">
<h1 style="margin: 0">404 Not Found</h1>
<p>您访问的文件不存在</p>
<p>如果您是网站所有者,请检查:</p>
<ul>
<li>域名解析配置是否正确</li>
<li>文件是否存在</li>
<li>伪静态规则是否正确</li>
</ul>
<p>如果您是一般访问者, 您可以:</p>
<ul>
<li>尝试联系网站所有者</li>
<li>检查链接是否正确</li>
<li>稍等一段时间再尝试访问</li>
<li><a href="https://jingyan.baidu.com/article/6d704a13fb6e1828db51ca3a.html" target="_blank">刷新您的 DNS 缓存</a> 或 更换网络环境访问</li>
</ul>
<div>
<p style="float: right; margin: 0">Powered by <a href="https://github.com/CoiaPrant/PortForwardGo">PortForwardGo</a></p>
</div>
</div>
<div style="position: static; width: 0px; height: 0px; border: none; padding: 0px; margin: 0px;"><div id="trans-tooltip"><div id="tip-left-top" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-left-top.png");"></div><div id="tip-top" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-top.png") repeat-x;"></div><div id="tip-right-top" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-right-top.png");"></div><div id="tip-right" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-right.png") repeat-y;"></div><div id="tip-right-bottom" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-right-bottom.png");"></div><div id="tip-bottom" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-bottom.png") repeat-x;"></div><div id="tip-left-bottom" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-left-bottom.png");"></div><div id="tip-left" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-left.png");"></div><div id="trans-content"></div></div><div id="tip-arrow-bottom" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-arrow-bottom.png");"></div><div id="tip-arrow-top" style="background: url("chrome-extension://ikkepelhgbcgmhhmcmpfkjmchccjblkd/imgs/map/tip-arrow-top.png");"></div></div></body></html>
`
func HttpStatus(statuscode int) string {
return `HTTP/1.1 ` + strconv.Itoa(statuscode) + `
Content-Type: text/html
`
}