Skip to content

Commit

Permalink
updated index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
netptop committed Mar 13, 2020
1 parent 555c642 commit b8b06d6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
3 changes: 2 additions & 1 deletion Proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ let Proxy = ({urlModify, httpprefix, serverName, port, cookieDomainRewrite, loca
onError: (err, req, res) => {
logSave(`onerror: ${JSON.stringify(err)}`)
try {
if (err.reason && err.reason.indexOf('Expected') === -1) {
if ((err.code && err.code === 'ECONNREFUSED') ||
(err.reason && err.reason.indexOf('Expected') === -1)) {
res.status(404).send(`{"error": "${err}"}`)
}
} catch(e) {
Expand Down
4 changes: 2 additions & 2 deletions api/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let cookieDomainRewrite = serverName
let proxy = Proxy({ urlModify, httpprefix, serverName, port, cookieDomainRewrite, locationReplaceMap302, regReplaceMap, siteSpecificReplace, pathReplace })
export default (req, res) => {
const dirPath = path.join(__dirname + '/..', req.url)
console.log(`req.url:${req.url}, dirPath=${dirPath}`)
console.log(`x-forward-for:${req.headers['x-forwarded-for']}, req.url:${req.url}`)
if (req.url === '/' || req.url === '/index.html') {
let body = fs.readFileSync(path.join(__dirname, '../index.html'), 'utf-8')
res.status(200).send(body)
Expand All @@ -20,4 +20,4 @@ export default (req, res) => {
return res.status(200).send(body)
}
proxy(req, res, null) // next: null
}
}
10 changes: 4 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,23 @@
<kiv class="container-width">
<div class="logo-container">
<div class="logo">
<a href="https://github.com/netptop/siteproxy">Github源码</a>
</div>
</div>
<div class="logo-right-container">
<div class="logo">
</div>
</div>
<br />
<div class="lead-title"> 从这里开始,不再被训戒</div>
<br />
<div class="descriptionSeg">1.建议您从浏览器打开网页,避免被微信窃听! </div>
<div class="descriptionSeg">1.请收藏项目开源网址:<a href="https://github.com/netptop/siteproxy">Github源码</a>以便在本网站失效后能找到新的网址
</div>
<br />
<div class="descriptionSeg">2.!!!请勿广泛传播本代理, 以便尽量推迟本代理的失效时间!!!</div>
<div class="descriptionSeg">2.建议您从浏览器打开网页,避免被微信窃听! </div>
<br />
<div class="descriptionSeg">3.由于从本代理发出的Google请求过多, google会自动限制搜索流量; 如果google不能用,请使用bing和yahoo搜索引擎. </div>
<br />
<div class="descriptionSeg">4.请降低youtube视频的分辨率,因为免费服务器每月的流量非常非常有限, 超过的话其他人都无法使用了 </div>
<br />
<div class="descriptionSeg">5.请登录telegram,加群@siteproxy,以便在本代理失效后及时获取更新</div>
<div class="descriptionSeg">5.请登录telegram,加群@siteproxy,以便及时获取更新</div>
<form class="lead-title">
<p>指定网址:<input class="lead-title" type="text" id="address" value="https://www.google.com">
<input id="addrAccess" class="lead-title button1" type="button" onclick="onsubmit" value="访问网站"/>
Expand Down
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ img {
}
.descriptionSeg{
top:10px;
font-size:20px;
font-size:24px;
font-family:Arial, Helvetica, sans-serif;
display:inline-block;
margin:10px 0 0 0;
Expand Down

0 comments on commit b8b06d6

Please sign in to comment.