Skip to content

Technical Description

Michael-X-Net edited this page Feb 3, 2023 · 1 revision

Code structure

+-XX-Net/
   |
   +-launcher/ loader, responsible for system startup, upgrade, WebUI framework management
   | |
   | +-lang/ Internationalization translation files
   | |
   | +-web_ui/ System web files
   |
   |
   |
   +-python27/ built-in python Windows interpreter and python library of each platform
   | |
   | +-1.0/
   | |
   | +-lib/
   | | |
   | | +-darwin/ MacOS-library
   | | |
   | | +-noarch/ platform independent library
   | | |
   | | +-win32/ library for windows platform
   | | |
   | | +-linux/ library for linux platform
   | |
   | +-Patch for WinSxS/ Windows platform
   |
   |
   |
   |
   +-data/ User data directory, created on first boot
   | |
   | +-launcher/ loader related data files
   | |
   | +-downloads/ Temporary directory for downloading files
   | |
   | +-gae_proxy/ gae_proxy related data directory
   | |
   | +-certs/ temporarily generated website certificate directory
   |
   |
   |
   +-gae_proxy/ GoAgent module
     |
     +-server/ server directory
     | |
     | +-lib/ The library of google app engine used for deployment
     | |
     | +-gae/ GAE server code
     |
     +-local/ local code
     |
     +-web_ui/ Follow the UI files of the launcher framework

Detailed instructions have been placed at the beginning of the source code, or at the beginning of the function/class. Put it at the beginning of the document to facilitate timely update and synchronization of the document. If you don't understand something, please communicate in the Issue area.

==================================================== ====== Launcher file introduction: init.py start.py startup file, called by start.xxx in the root directory config.py system configuration file logging.py log management module_init.py module start and stop management update_from_github.py download update package from github update.py query updates from appspot autorun.py boot settings web_control.py WebUI control code gtk_tray.py Linux tray mac_tray.py MacOS Tray win_tray.py Windows Tray non_tray.py Tray without desktop, for Linux/openwrt etc. simple_i18n.py Simple implementation of internationalization setup_win_python.py for patching Windows create_shortcut.js steps to create Windows desktop icons

==================================================== ====== ****GAE_proxy file introduction: **** init.py proxy.py startup file, called by start.py in the upper directory proxy.ini default configuration file, please do not modify appids_manager.py appid manager check_ip.py Execution module for scanning ip, including various test codes config.py configuration loader connect_control.py connection control, currently useless connect_manager.py connection pool manager direct_handler.py google business direct connection method gae_handler.py GAE agent business layer generate_ip_range.py generates scan ip range files, which can merge overlapping ranges, usually not used good_ip.txt automatic available ip library good_ipv6.txt available library for ipv6 google_ip.py google ip management module google_ip_range.py loads the google ip module and randomly selects an ip within the range ip_range.txt Scanned ip range file ip_utils.py auxiliary library logging.py log management module openssl_wrap.py wraps the openssl library pac_server.py PAC automatic proxy service proxy.pac Automatic configuration file proxy_handler.py proxy port service, after parsing, forward the request to gae_handler and direct_handler scan_ip_log.py scan ip log management web_control.py WebUI control implementation module cert_util.py certificate management: generate, import cacert.pem Verify the certificate library of the google server

==================================================== =======

launcher introduction:

Launcher Framework Features:

  • Implemented Python support for Windows/Linux/Mac 3 platforms Python has a low threshold, a variety of libraries, and good performance (completely sufficient for single-user use) Cross-platform, the code is clear and easy to maintain. Platform support for Android/IOS is being developed. Implement a set of code to run on 5 platforms

  • systray implementation Facilitate the operation of background processes on the desktop

  • Autoload function at system startup

  • Web-based UI framework Technologies such as Html5/js/CSS have low barriers to entry, cross-platform, and more people can participate. Support for international translation

  • automatic upgrade User-friendly way to upgrade Easy version management for development

==================================================== =======

GAE_proxy technical point introduction:

  • IP scanning Each time, randomly select an ip from the IP range pool, test the connection and judge the validity, and record the handshake time IP range pools can be added and modified on the WebUI; The scanning thread can be adjusted; Automatic adjustment is enabled by default: sort the handshake time, and adjust the scanning thread according to the handshake time of the 100th ip; If the handshake is less than 200ms, stop scanning, if the handshake time is greater than 300ms, scan at full speed.

    The WebUI has the function of importing and exporting IP, which is convenient for users who use the official goagent

    Up to 3000 ips are reserved, if there are more, the slowest ip will be removed after joining.

  • IP management mechanism Sort by ip handshake time; Each time you use ip, it is automatically selected from the minimum handshake time; Only one ssl connection is established for each ip, and multiple connections will trigger the GFW rule to fail when a large amount of data is transmitted The ip that fails to connect will be ranked behind when sorting In order to avoid making all IPs invalid when the network is unreachable, we will visit a reliable website to judge. Currently, we use Baidu to judge

  • connection pool When the ip quality is insufficient, it is necessary to maintain an available connection pool to meet the needs and respond immediately. Currently 10 connections are kept by default. Each connection needs to be active every 60 seconds, otherwise the server will be disconnected. The used connection will be recycled to the connection pool and can be reused next time The host of the used connection cannot be changed, so when the appid is modified, all connections must be rebuilt

==================================================== =======

Product design:

Overpassing the wall itself is a troublesome thing. How to lower the threshold and let more people go over the wall.

Therefore, the XX suite adopts the method of Web interface management, and minimizes the methods of command lines and configuration files. The web interface also keeps a brief introduction as much as possible, and various prompts only appear when needed. For example, relevant prompts will be displayed only after the appid input box is clicked.

Standalone use for advanced users

  • The gae_proxy/local directory can work independently, and can be started directly by using python proxy.py.
  • gae_proxy/server can deploy the server from the command line, and use python uploader.py or uploader.bat to deploy from the command line

Version Management Instructions

Version Management

Technology Selection

Python language selection

Clone this wiki locally