Fix start.vbs , test-appid , disable x-tunnel and change python path in some files
diff --git a/gae_proxy/local/cert_util.py b/gae_proxy/local/cert_util.py
index 68bed1798b..98809d46ce 100644
--- a/gae_proxy/local/cert_util.py
+++ b/gae_proxy/local/cert_util.py
@@ -13,13 +13,12 @@
 import subprocess
 
 current_path = os.path.dirname(os.path.abspath(__file__))
-root_path = os.path.abspath( os.path.join(current_path, os.pardir, os.pardir))
-python_path = os.path.abspath( os.path.join(current_path, os.pardir, os.pardir, 'python27', '1.0'))
 data_path = os.path.abspath(os.path.join(current_path, os.pardir, os.pardir, 'data', 'gae_proxy'))
 if not os.path.isdir(data_path):
     data_path = current_path
 
 if __name__ == "__main__":
+    root_path = os.path.abspath( os.path.join(current_path, os.pardir, os.pardir))
     noarch_lib = os.path.join(root_path, 'lib', 'noarch')
     sys.path.append(noarch_lib)
 
diff --git a/gae_proxy/local/check_local_network.py b/gae_proxy/local/check_local_network.py
index 67893735bc..f77e53127e 100644
--- a/gae_proxy/local/check_local_network.py
+++ b/gae_proxy/local/check_local_network.py
@@ -7,19 +7,22 @@
 import socket
 import threading
 
-current_path = os.path.dirname(os.path.abspath(__file__))
-
 if __name__ == "__main__":
-    python_path = os.path.abspath( os.path.join(current_path, os.pardir, os.pardir, 'python27', '1.0'))
+    current_path = os.path.dirname(os.path.abspath(__file__))
+    root_path = os.path.abspath(os.path.join(current_path, os.pardir, os.pardir))
+    gae_path = os.path.join(root_path, "gae_proxy")
+    sys.path.append(gae_path)
 
-    noarch_lib = os.path.abspath( os.path.join(python_path, 'lib', 'noarch'))
+    noarch_lib = os.path.join(root_path, 'lib', 'noarch')
     sys.path.append(noarch_lib)
+    common_lib = os.path.join(root_path, 'lib', 'common')
+    sys.path.append(common_lib)
 
     if sys.platform == "win32":
-        win32_lib = os.path.abspath( os.path.join(python_path, 'lib', 'win32'))
+        win32_lib = os.path.join(root_path, 'lib', 'win32')
         sys.path.append(win32_lib)
     elif sys.platform.startswith("linux"):
-        linux_lib = os.path.abspath( os.path.join(python_path, 'lib', 'linux'))
+        linux_lib = os.path.join(root_path, 'lib', 'linux')
         sys.path.append(linux_lib)
 
 import OpenSSL
diff --git a/gae_proxy/local/google_ip.py b/gae_proxy/local/google_ip.py
index 01fbe6ffc7..252ba28b30 100644
--- a/gae_proxy/local/google_ip.py
+++ b/gae_proxy/local/google_ip.py
@@ -352,7 +352,7 @@ def update_ip(self, ip, handshake_time):
 
         handshake_time = int(handshake_time)
         if handshake_time < 5: # that's impossible
-            xlog.warn("%s handshake:%d impossible", ip, 1000 * handshake_time)
+            xlog.debug("%s handshake:%d impossible or wrong", ip, 1000 * handshake_time)
             return
 
         time_now = time.time()
diff --git a/gae_proxy/local/proxy.py b/gae_proxy/local/proxy.py
index 2a4860c955..56caf920ff 100644
--- a/gae_proxy/local/proxy.py
+++ b/gae_proxy/local/proxy.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
 # coding:utf-8
 # Based on GAppProxy 2.0.0 by Du XiaoGang <dugang.2008@gmail.com>
 # Based on WallProxy 0.4.0 by Hust Moon <www.ehust@gmail.com>
diff --git a/gae_proxy/local/test_appid.py b/gae_proxy/local/test_appid.py
index 8a93334271..a088d0b4d6 100644
--- a/gae_proxy/local/test_appid.py
+++ b/gae_proxy/local/test_appid.py
@@ -3,13 +3,13 @@
 from xlog import getLogger
 xlog = getLogger("gae_proxy")
 
-from .connect_manager import https_manager
+from local.connect_manager import https_manager
 
 
 def test_appid_exist(ssl_sock, 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 = http.client.HTTPResponse(ssl_sock, buffering=True)
+    response = http.client.HTTPResponse(ssl_sock)
 
     response.begin()
     if response.status == 404:
@@ -24,7 +24,7 @@ def test_appid_exist(ssl_sock, appid):
         xlog.warn("test appid %s status:%d", appid, response.status)
 
     content = response.read()
-    if "GoAgent" not in content:
+    if b"GoAgent" not in content:
         #xlog.warn("app check %s content:%s", appid, content)
         return False
 
diff --git a/launcher/autorun.py b/launcher/autorun.py
index 7877e53309..979f4b0ce6 100644
--- a/launcher/autorun.py
+++ b/launcher/autorun.py
@@ -44,7 +44,7 @@ def remove(name):
         winreg.DeleteValue(key, name)
         winreg.CloseKey(key)
 
-    run_cmd = "\"" + os.path.abspath( os.path.join(root_path, "python27", "1.0", "pythonw.exe")) + "\" \"" +\
+    run_cmd = "\"" + os.path.abspath( os.path.join(root_path, "python3", "python.exe")) + "\" \"" +\
               os.path.abspath( os.path.join(root_path, "launcher", "start.py")) + "\""
 elif sys.platform.startswith('linux'):
     _xdg_config_home = os.environ.get("XDG_CONFIG_HOME", "~/.config")
diff --git a/launcher/config.py b/launcher/config.py
index 4ef5b00653..b9d2aea15c 100644
--- a/launcher/config.py
+++ b/launcher/config.py
@@ -60,7 +60,7 @@ def recheck_module_path():
     global config
     need_save_config = False
 
-    modules = ["gae_proxy", "launcher", "php_proxy", "x_tunnel"]
+    modules = ["gae_proxy", "launcher", "php_proxy"]
     for module in modules:
         if module not in ["launcher", "php_proxy"]:
             if not os.path.isdir(os.path.join(root_path, module)):
diff --git a/launcher/create_shortcut.js b/launcher/create_shortcut.js
index 91798604db..d5ade771b8 100644
--- a/launcher/create_shortcut.js
+++ b/launcher/create_shortcut.js
@@ -2,7 +2,7 @@
 function CreateShortcut()
 {
    wsh = new ActiveXObject('WScript.Shell');
-   target_path = '"' + wsh.CurrentDirectory + '\\..\\python27\\1.0\\pythonw.exe"';
+   target_path = '"' + wsh.CurrentDirectory + '\\..\\python3\\python.exe"';
    icon_path = wsh.CurrentDirectory + '\\web_ui\\favicon.ico';
 
 
diff --git a/launcher/setup.py b/launcher/setup.py
index 5015cee2d9..383f65e74b 100644
--- a/launcher/setup.py
+++ b/launcher/setup.py
@@ -4,7 +4,7 @@
 import sys
 
 current_path = os.path.dirname(os.path.abspath(__file__))
-python_path = os.path.abspath( os.path.join(current_path, os.pardir, 'python27', '1.0'))
+python_path = os.path.abspath( os.path.join(current_path, os.pardir, 'python3'))
 noarch_lib = os.path.abspath( os.path.join(python_path, 'lib', 'noarch'))
 sys.path.append(noarch_lib)
 
diff --git a/launcher/setup_win_python.py b/launcher/setup_win_python.py
index e46e3f6e2c..6116e6232d 100644
--- a/launcher/setup_win_python.py
+++ b/launcher/setup_win_python.py
@@ -6,7 +6,7 @@
 import time
 
 current_path = os.path.dirname(os.path.abspath(__file__))
-python_path = os.path.abspath( os.path.join(current_path, os.pardir, 'python27', '1.0'))
+python_path = os.path.abspath( os.path.join(current_path, os.pardir, 'python3'))
 
 def copy_VCR_files():
     src_path = os.path.join(python_path, "WinSxS")
diff --git a/launcher/update_from_github.py b/launcher/update_from_github.py
index 5c5f54ca0b..9792424f41 100644
--- a/launcher/update_from_github.py
+++ b/launcher/update_from_github.py
@@ -13,7 +13,7 @@
 
 current_path = os.path.dirname(os.path.abspath(__file__))
 root_path = os.path.abspath( os.path.join(current_path, os.pardir))
-python_path = os.path.join(root_path, 'python27', '1.0')
+python_path = os.path.join(root_path, 'python3')
 noarch_lib = os.path.join(python_path, 'lib', 'noarch')
 sys.path.append(noarch_lib)
 
@@ -250,4 +250,4 @@ def delete_file(file):
     delete_file(os.path.join(root_path, "gae_proxy", "local", "xlog.py"))
     delete_file(os.path.join(root_path, "gae_proxy", "local", "xlog.pyc"))
 
-clean_old_file()
\ No newline at end of file
+clean_old_file()
diff --git a/lib/noarch/socks.py b/lib/noarch/socks.py
index a9d3ec61c5..a6bfecb3d2 100644
--- a/lib/noarch/socks.py
+++ b/lib/noarch/socks.py
@@ -55,10 +55,9 @@
 __version__ = "1.5.1"
 
 import os, sys
-current_path = os.path.dirname(os.path.abspath(__file__))
-python_path = os.path.abspath( os.path.join(current_path, os.pardir, os.pardir, 'python27', '1.0'))
 if sys.platform == "win32":
-    win32_lib = os.path.abspath( os.path.join(python_path, 'lib', 'win32'))
+    current_path = os.path.dirname(os.path.abspath(__file__))
+    win32_lib = os.path.abspath( os.path.join(current_path, os.pardir, 'win32'))
     sys.path.append(win32_lib)
 
 import socket
@@ -726,4 +725,4 @@ def check_ip_valid(ip):
 if __name__ == "__main__":
     name = "abc"
     name2 = name.encode('idna')
-    print(name2)
\ No newline at end of file
+    print(name2)
diff --git a/start.vbs b/start.vbs
index 9d4dc5c411..512f8e6853 100644
--- a/start.vbs
+++ b/start.vbs
@@ -7,5 +7,5 @@ strFolder = objFSO.GetParentFolderName(objFile)
 
 Dim strArgs
 quo = """"
-strArgs = quo & strFolder & "/python27/1.0/pythonw.exe" & quo & " " & quo & strFolder & "/launcher/start.py " & quo
+strArgs = quo & strFolder & "/python3/python.exe" & quo & " " & quo & strFolder & "/launcher/start.py " & quo
 oShell.Run strArgs, 0, false
\ No newline at end of file

1. temporary disable x_tunnel
2. fix start.vbs
3. fix test appid
4. change python path in some files
