Skip to content

Commit 1224c43

Browse files
committed
add public limit notification.
1 parent f67b970 commit 1224c43

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

goagent/3.1.38/local/proxy.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ talkx.l.google.com = gws
4444
.gstatic.com = gws
4545
.appspot.com = gws
4646
;.android.com = gws
47-
.youtube.com = gws
47+
;.youtube.com = gws
4848
.ggpht.com = gws
4949
.2mdn.net = gws
5050
.googlesyndication.com = gws

goagent/3.1.38/local/proxy_handler.py

+12-4
Original file line numberDiff line numberDiff line change
@@ -487,15 +487,23 @@ def do_AGENT(self):
487487
else:
488488
continue
489489

490+
# public gae appid deny this site request.
491+
if response.app_status == 403:
492+
logging.warn("public appid deny this host:%s", host)
493+
html = generate_message_html('403 public Appid deny this host proxy', u'共用appid因为资源有限,限制观看视频和文件下载等消耗资源过多的访问,请使用自己的appid')
494+
self.wfile.write(b'HTTP/1.0 403\r\nContent-Type: text/html\r\n\r\n' + html.encode('utf-8'))
495+
response.close()
496+
return
497+
490498
# appid not exists, try remove it from appid
491499
if response.app_status == 404:
492500
logging.warning('APPID %r not exists, remove it.', response.ssl_sock.appid)
493501
appid_manager.report_not_exist(response.ssl_sock.appid)
494502
appid = appid_manager.get_appid()
495503

496504
if not appid:
497-
html = generate_message_html('404 No usable Appid Exists', 'No usable Appid Exists, please add appid')
498-
self.wfile.write(b'HTTP/1.0 502\r\nContent-Type: text/html\r\n\r\n' + html.encode('utf-8'))
505+
html = generate_message_html('404 No usable Appid Exists', u'没有可用appid了,请配置可用的appid')
506+
self.wfile.write(b'HTTP/1.0 404\r\nContent-Type: text/html\r\n\r\n' + html.encode('utf-8'))
499507
response.close()
500508
return
501509
else:
@@ -508,8 +516,8 @@ def do_AGENT(self):
508516
appid = appid_manager.get_appid()
509517

510518
if not appid:
511-
html = generate_message_html('404 No usable Appid Exists', 'No usable Appid Exists, please add appid')
512-
self.wfile.write(b'HTTP/1.0 502\r\nContent-Type: text/html\r\n\r\n' + html.encode('utf-8'))
519+
html = generate_message_html('503 No usable Appid Exists', u'appid流量不足,请增加appid')
520+
self.wfile.write(b'HTTP/1.0 503\r\nContent-Type: text/html\r\n\r\n' + html.encode('utf-8'))
513521
response.close()
514522
return
515523
else:

0 commit comments

Comments
 (0)