Specialized ZJU Rules
Relevant source files
The following files were used as context for generating this wiki page:
The Specialized ZJU (Zhejiang University) Rules are a set of custom Clash rule providers designed to manage network traffic for users affiliated with Zhejiang University. Their primary purpose is to correctly route traffic to ZJU's internal network services, IP-authenticated academic resources, and services related to international joint programs. These rules ensure that on-campus users have direct access, while off-campus users can access these resources through the university's VPN or other intranet access methods.
These YAML-based provider files are part of a larger collection of self-use routing rules. They are generated from simpler .list files, which are then processed into the final Clash-compatible format. The rules are categorized into distinct files for better maintainability, covering the main ZJU intranet, additional scholarly resources, and international program services.
Sources: Clash/Providers/ZJU.yaml, README.md, update_providers.py
Rule Architecture and Generation
The ZJU rules are defined in standard Clash provider YAML files. Each file contains a payload section, which is a list of individual rule definitions. The primary rule types used are DOMAIN-SUFFIX and DOMAIN-KEYWORD.
DOMAIN-SUFFIX: Matches any domain ending with the specified suffix.DOMAIN-KEYWORD: Matches any domain containing the specified keyword.
These YAML provider files are automatically generated by the update_providers.py script. This script reads .list files, processes each line, and writes it into a .yaml file under the payload: key.
Sources: Clash/Providers/ZJU.yaml:1-7, update_providers.py:15-37
Generation Flow
The diagram below illustrates the process of converting a .list rule file into a Clash-compatible .yaml provider file.
This diagram shows the automated conversion of rule lists into YAML format for Clash.
Sources: update_providers.py:15-37
Core ZJU Intranet Rules (ZJU.yaml)
This is the primary rule set for the ZJU network. It is designed to route traffic for services that should be accessed via the university's network. As noted in the file, this means "校内直连,校外通过内网穿透或 RVPN 访问" (direct connection on-campus, access via intranet traversal or RVPN off-campus).
Sources: Clash/Providers/ZJU.yaml:2-4
General ZJU Domains
This section covers the main university domain and domains of various student organizations and affiliated platforms.
| Organization/Platform | Domain Rule Type | Value |
|---|---|---|
| Zhejiang University | DOMAIN-SUFFIX | zju.edu.cn |
| CC98 Forum | DOMAIN-KEYWORD | cc98 |
| NexusHD Tracker | DOMAIN-KEYWORD | nexushd |
| ICSR WIKI | DOMAIN-SUFFIX | icsr.wiki |
| ZJU School-Bus (ZJUSec) | DOMAIN-SUFFIX | zjusec.com, zjusec.net, zjusec.top |
| ZJU SCT | DOMAIN-SUFFIX | zjusct.io |
| ZJU EVA | DOMAIN-SUFFIX | zjueva.net |
| ZJU QSC | DOMAIN-SUFFIX | zjuqsc.com |
Sources: Clash/Providers/ZJU.yaml:7-25
IP-Authenticated Academic Resources
This sub-section contains a list of external academic resources that use IP-based authentication. For access, users must appear to be coming from a ZJU IP address, which necessitates routing this traffic through the ZJU network when off-campus. The file explicitly states not to add foreign resources that are accessible via unified identity authentication, as those do not require ZJU's network environment.
Key resources in this list include:
acm.orgcnki.netjstor.orgwebofscience.comscience.orgaps.orgieee.orgspringer.comrsc.org
Sources: Clash/Providers/ZJU.yaml:27-99
Access Logic for ZJU Resources
The following diagram shows the intended traffic flow for resources listed in ZJU.yaml.
This diagram depicts how access to ZJU-specific resources is handled based on the user's location.
Sources: Clash/Providers/ZJU.yaml:3-4
Additional Academic Resources (ZJU-More-Scholar.yaml)
This file extends the academic resource list. It is specifically for resources that can be accessed via both unified identity authentication and IP-based authentication. This differs from ZJU.yaml, which focuses on resources primarily requiring a ZJU IP.
Notable domains include:
canvas-user-content.comieee.orgsciencedirect.comnature.comwiley.comproquest.com
Sources: Clash/Providers/ZJU-More-Scholar.yaml:2-20
ZJU International Program Rules (ZJU-INTL.yaml)
This rule set is tailored for ZJU's international programs, with a specific focus on the ZJU-UIUC institute. It includes domains and keywords related to the University of Illinois Urbana-Champaign (UIUC) and associated services.
Key rules include:
- Keywords:
illinois,shibboleth,uiuc - Services:
duosecurity.com,gradescope.com,zoom.us
Sources: Clash/Providers/ZJU-INTL.yaml:3-16
ZJU-INTL Traffic Flow
This diagram shows how traffic for ZJU's international programs is identified and routed.
Sources: Clash/Providers/ZJU-INTL.yaml:6-16
Relationship Between ZJU and General Scholar Rules
The ZJU-specific rules overlap with the general Scholar.yaml ruleset, which contains a broad list of academic websites. The ZJU rules provide a more specialized function: ensuring certain academic sites are accessed via the university network for IP authentication. In contrast, Scholar.yaml is likely used in a more general policy to route academic traffic through a proxy for users who are not on the ZJU network.
The diagram below shows the relationship between these rule sets.
This diagram illustrates the overlapping domains between the specialized ZJU rule files and the general Scholar.yaml rule file.
Sources: Clash/Providers/ZJU.yaml, Clash/Providers/ZJU-More-Scholar.yaml, Clash/Providers/Ruleset/Scholar.yaml
Conclusion
The specialized ZJU rules are a crucial component of this repository for users at Zhejiang University. They provide a fine-grained routing policy to handle the unique network requirements of a university environment, separating general intranet traffic, IP-authenticated external services, and international program resources into manageable, distinct rule providers. This modular approach allows for easy updates and ensures reliable access to academic and internal services regardless of the user's physical location.