Skip to content

Commit

Permalink
fix bug: check appid not work for old GoAgent deployed appid, add sto…
Browse files Browse the repository at this point in the history
…p check all exist ip, release 2.8.5
  • Loading branch information
xxnet committed Dec 26, 2015
1 parent 3773211 commit b680980
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 48 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ XX-Net - A Rebirth of Goagent
下载链接(Download):
==========
测试版(Test):
https://codeload.github.com/XX-net/XX-Net/zip/2.8.4
https://codeload.github.com/XX-net/XX-Net/zip/2.8.5

稳定版(Stable):
https://codeload.github.com/XX-net/XX-Net/zip/2.7.3
Expand Down Expand Up @@ -69,14 +69,18 @@ https://github.com/XX-net/XX-Net/wiki/How-to-contribute
主页(Main page):http://www.ccav1.com/chromegae
集成Google Chrome和XX-Net的自动翻墙浏览器(An automatic comobo of Google Chrome browser and XX-Net)
维护人(Maintainer):Yanu

* 集成Chrome和XX-Net (XX-Net-integrated Chrome)
https://github.com/yeahwu/chrome-xx

* plusburg
主页(Main page):https://github.com/Plusburg/Plusburg
集成XX-Net的启动光盘镜像 (XX-Net-integrated bootable CD image)

* appifed-xx-net
https://github.com/binarydist/appified-xx-net
Mac OS X 环境下,变成一个标准的Mac应用(A standard Mac app on Mac OS X)

* ComodoDragonPortable:
为XX-Net和Lantern定制的便携浏览器(A customized portable browser for XX-Net & Lantern)
https://github.com/mikedchavez1010/ComodoDragonPortable
Expand Down
22 changes: 4 additions & 18 deletions gae_proxy/lang/en_US/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2015-12-23 22:40+0800\n"
"POT-Creation-Date: 2015-12-26 08:51+0800\n"
"PO-Revision-Date: 2015-12-06 09:14+0800\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: en_US\n"
"Language-Team: en_US <[email protected]>\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 1.3\n"
"Generated-By: Babel 2.1.1\n"

msgid "Scan Settings"
msgstr ""
Expand Down Expand Up @@ -61,7 +62,7 @@ msgstr ""
msgid "No response from GAEProxy process. It might have already exited."
msgstr ""

msgid "Running"
msgid "Stop"
msgstr ""

msgid "Public appids used by default"
Expand Down Expand Up @@ -447,18 +448,3 @@ msgstr ""


















10 changes: 6 additions & 4 deletions gae_proxy/lang/fa_IR/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2015-12-23 22:40+0800\n"
"POT-Creation-Date: 2015-12-26 08:51+0800\n"
"PO-Revision-Date: 2015-12-06 09:14+0800\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: fa_IR\n"
"Language-Team: fa_IR <[email protected]>\n"
"Plural-Forms: nplurals=1; plural=0\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 1.3\n"
"Generated-By: Babel 2.1.1\n"

msgid "Scan Settings"
msgstr "تنظیمات اسکن"
Expand Down Expand Up @@ -61,8 +62,8 @@ msgstr "اجرا"
msgid "No response from GAEProxy process. It might have already exited."
msgstr "هیچ پاسخی از روند GAEProxy. این ممکن است در حال حاضر خارج می شود."

msgid "Running"
msgstr "در حال اجرا"
msgid "Stop"
msgstr "متوقف کردن"

msgid "Public appids used by default"
msgstr "appids عمومی استفاده می شود به طور پیش فرض"
Expand Down Expand Up @@ -458,3 +459,4 @@ msgid "Proxy disabled"
msgstr "پروکسی غیرفعال"



11 changes: 7 additions & 4 deletions gae_proxy/lang/zh_CN/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2015-12-23 22:40+0800\n"
"POT-Creation-Date: 2015-12-26 08:51+0800\n"
"PO-Revision-Date: 2015-12-16 15:55+0800\n"
"Last-Translator: XX-Net <[email protected]>\n"
"Language: zh_Hans_CN\n"
"Language-Team: zh_Hans_CN <[email protected]>\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 1.3\n"
"Generated-By: Babel 2.1.1\n"

msgid "Scan Settings"
msgstr "设置"
Expand Down Expand Up @@ -61,8 +62,8 @@ msgstr "运行"
msgid "No response from GAEProxy process. It might have already exited."
msgstr "GAEProxy进程无响应, 可能已退出。"

msgid "Running"
msgstr "运行中"
msgid "Stop"
msgstr "停止"

msgid "Public appids used by default"
msgstr "默认使用公共appid"
Expand Down Expand Up @@ -451,3 +452,5 @@ msgstr "全局代理已启用:"
msgid "Proxy disabled"
msgstr "全局代理已禁用"



4 changes: 3 additions & 1 deletion gae_proxy/local/check_ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def get_ssl_cert_domain(ssl_sock):


def check_appid(ssl_sock, appid, ip):
request_data = 'GET /_gh HTTP/1.1\r\nHost: %s.appspot.com\r\n\r\n' % appid
request_data = 'GET /_gh/ HTTP/1.1\r\nHost: %s.appspot.com\r\n\r\n' % appid
ssl_sock.send(request_data.encode())
response = httplib.HTTPResponse(ssl_sock, buffering=True)

Expand Down Expand Up @@ -281,6 +281,8 @@ def test_gae_ip(ip, appid=None):

if not appid:
appid = appid_manager.get_appid()
if appid.startswith("xxnet-"):
appid = "xxnet-check"
if not check_appid(ssl_sock, appid, ip):
return False

Expand Down
7 changes: 6 additions & 1 deletion gae_proxy/local/google_ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@ def scan_all_exist_ip(self):
self.scan_exist_ip_queue.put(ip)
xlog.debug("start scan all exist ip, num:%d", self.scan_exist_ip_queue.qsize())

self.keep_scan_all_exist_ip = True
scan_threads = []
for i in range(0, 10):
th = threading.Thread(target=self.scan_exist_ip_worker, )
Expand All @@ -598,8 +599,12 @@ def start_scan_all_exist_ip(self):
th = threading.Thread(target=self.scan_all_exist_ip)
th.start()

def stop_scan_all_exist_ip(self):
self.keep_scan_all_exist_ip = False
self.scan_exist_ip_queue = Queue.Queue()

def scan_exist_ip_worker(self):
while connect_control.keep_running:
while connect_control.keep_running and self.keep_scan_all_exist_ip:
try:
ip = self.scan_exist_ip_queue.get_nowait()
except:
Expand Down
2 changes: 1 addition & 1 deletion gae_proxy/local/test_appid.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


def test_appid_exist(ssl_sock, appid):
request_data = 'GET / HTTP/1.1\r\nHost: %s.appspot.com\r\n\r\n' % appid
request_data = 'GET /_gh/ HTTP/1.1\r\nHost: %s.appspot.com\r\n\r\n' % appid
ssl_sock.send(request_data.encode())
response = httplib.HTTPResponse(ssl_sock, buffering=True)

Expand Down
9 changes: 8 additions & 1 deletion gae_proxy/local/web_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,14 @@ def req_check_ip_handler(self):
if left_num:
self.send_response('text/plain', '{"res":"fail", "reason":"running"}')
else:
google_ip.start_scan_all_exist_ip()
self.send_response('text/plain', '{"res":"success"}')
elif reqs['cmd'] == ['stop']:
left_num = google_ip.scan_exist_ip_queue.qsize()
if not left_num:
self.send_response('text/plain', '{"res":"fail", "reason":"not running"}')
else:
google_ip.stop_scan_all_exist_ip()
self.send_response('text/plain', '{"res":"success"}')
google_ip.scan_all_exist_ip()
else:
return self.send_not_exist()
48 changes: 31 additions & 17 deletions gae_proxy/web_ui/check_ip.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,38 +77,52 @@ <h4>{{ _( "Status" ) }}</h4>
$('#check_start').removeClass('btn-inverse');
$('#check_start').addClass('btn-primary');
$('#check_start').html('{{ _( "Run" ) }}');
//console.log("enable");
}
}
function disableStartButton(){
if ($('#check_start').hasClass("btn-primary")){
$('#check_start').removeClass('btn-primary');
$('#check_start').addClass('btn-inverse');
$('#check_start').html('{{ _( "Running" ) }}');
//console.log("disable");
$('#check_start').html('{{ _( "Stop" ) }}');
}
}
</script>

<script type="text/javascript">
$('button.btn').click(function() {
$.ajax({
type: 'GET',
url: '/module/gae_proxy/control/check_ip?cmd=start',
dataType: 'JSON',
success: function(result) {
window.timer.play();
if ( $('#check_start').html() == '{{ _( "Run" ) }}' ){
$.ajax({
type: 'GET',
url: '/module/gae_proxy/control/check_ip?cmd=start',
dataType: 'JSON',
success: function(result) {
window.timer.play();

disableStartButton();
disableStartButton();

if ( !tipHasClose() ) {
tipClose();
if ( !tipHasClose() ) {
tipClose();
}
},
error: function(result) {
tip('{{ _( "No response from GAEProxy process. It might have already exited." ) }}', 'warning', false);
}
},
error: function(result) {
tip('{{ _( "No response from GAEProxy process. It might have already exited." ) }}', 'warning', false);
}
});
});
}else{
$.ajax({
type: 'GET',
url: '/module/gae_proxy/control/check_ip?cmd=stop',
dataType: 'JSON',
success: function(result) {
if ( !tipHasClose() ) {
tipClose();
}
},
error: function(result) {
tip('{{ _( "No response from GAEProxy process. It might have already exited." ) }}', 'warning', false);
}
});
}
});
</script>

Expand Down

0 comments on commit b680980

Please sign in to comment.