Gaming & Entertainment Rules
Relevant source files
The following files were used as context for generating this wiki page:The Self-Rule repository provides a set of custom traffic-splitting rules for proxy clients like Clash, based on the ACL4SSR project. The Gaming & Entertainment rules are a specific subset of these configurations designed to manage network traffic for various gaming platforms, download services, and media streaming sites. The primary goal is to ensure optimal connectivity by routing traffic for these services appropriately, either through a proxy or via a direct connection.
These rules are defined in YAML files, which act as "rule providers" for Clash. They contain lists of domains and IP addresses associated with specific services. The system also utilizes a general configuration file that can bypass the system proxy for certain domains, providing another layer of traffic management.
Rule Structure and Processing
The rules for gaming and entertainment services are defined in individual YAML files located primarily within the Clash/Providers/Ruleset/ and Clash/Providers/ directories. Each file contains a payload section listing domain-based rules.
The diagram below illustrates how different rule files are organized to cover various gaming and entertainment services.
This diagram shows the relationship between different rule provider files for gaming and entertainment services.
Sources: Clash/Providers/ProxyMedia.yaml, Clash/Providers/Ruleset/GameDownload.yaml, Clash/Providers/Ruleset/Steam.yaml, Clash/Providers/Ruleset/Blizzard.yaml, Clash/Providers/Xbox.yaml, Clash/Providers/Ruleset/Epic.yaml, Clash/GeneralClashConfig.yml
Core Gaming Platforms
The repository contains specific rule sets for major gaming platforms to ensure their services and download servers are correctly routed.
Steam
Rules for Steam are split between a dedicated provider file and the main Clash configuration for system-level bypasses, particularly for the Chinese region.
Provider Rules
The Steam.yaml file contains rules for global Steam services, including community, store, and content delivery networks.
# Source: Clash/Providers/Ruleset/Steam.yaml:1-17
payload:
# 内容:Steam
# 数量:15条
- DOMAIN-SUFFIX,playartifact.com
- DOMAIN-SUFFIX,steam-chat.com
- DOMAIN-SUFFIX,steamcommunity.com
- DOMAIN-SUFFIX,steamgames.com
- DOMAIN-SUFFIX,steampowered.com
- DOMAIN-SUFFIX,steamserver.net
- DOMAIN-SUFFIX,steamstatic.com
- DOMAIN-SUFFIX,steamstat.us
- DOMAIN-SUFFIX,underlords.com
- DOMAIN-SUFFIX,valvesoftware.com
- DOMAIN,steambroadcast.akamaized.net
- DOMAIN,steamcommunity-a.akamaihd.net
- DOMAIN,steamstore-a.akamaihd.net
- DOMAIN,steamusercontent-a.akamaihd.net
- DOMAIN,steamuserimages-a.akamaihd.net
Sources: Clash/Providers/Ruleset/Steam.yaml:1-17
System Proxy Bypass for SteamCN
The GeneralClashConfig.yml file includes a cfw-bypass section that lists domains to be excluded from the system proxy. This is used for Steam China-specific domains to ensure they are connected to directly.
| Domain | Purpose |
|---|---|
*.cm.steampowered.com | Steam Connection Manager |
*.steamcontent.com | Steam Content Delivery |
*.steamusercontent.com| User-generated content |
|*.steamchina.com| Steam China official domain |
|csgo.wmsj.cn| CS:GO (Perfect World) |
|dota2.wmsj.cn| Dota 2 (Perfect World) |
|wmsjsteam.com| Perfect World Steam |
| Various CDN domains | Content delivery network hosts for downloads |
Sources: Clash/GeneralClashConfig.yml:517-531
Epic Games
Epic Games rules are defined in Epic.yaml for the main platform and GameDownload.yaml for content delivery. An unban rule is also present.
| File | Rule Type | Domain |
|---|---|---|
Epic.yaml | DOMAIN-SUFFIX | epicgames.com |
Epic.yaml | DOMAIN-SUFFIX | epicgames.dev |
Epic.yaml | DOMAIN-SUFFIX | unrealengine.com |
GameDownload.yaml | DOMAIN | download.epicgames.com |
GameDownload.yaml | DOMAIN | epicgames-download1.akamaized.net |
UnBan.yaml | DOMAIN-SUFFIX | ol.epicgames.com |
Sources: Clash/Providers/Ruleset/Epic.yaml:3-8, Clash/Providers/Ruleset/GameDownload.yaml:11-15, Clash/Providers/UnBan.yaml:4-5
Blizzard
The Blizzard.yaml file handles traffic for Blizzard Entertainment's games and services.
# Source: Clash/Providers/Ruleset/Blizzard.yaml:1-10
payload:
# 内容:Blizzard 暴雪
# 数量:8条
- DOMAIN-SUFFIX,battle.net
- DOMAIN-SUFFIX,blizzard.com
- DOMAIN-SUFFIX,blizzard.net
- DOMAIN-SUFFIX,blizzardcdn.com
- DOMAIN-SUFFIX,wowchina.com
- DOMAIN-SUFFIX,wowtaiwan.com
- DOMAIN-SUFFIX,hearthstone.com.cn
- DOMAIN-SUFFIX,playoverwatch.com
Sources: Clash/Providers/Ruleset/Blizzard.yaml:1-10
Xbox
Xbox services, including Live and game package downloads, are managed by rules in Xbox.yaml and GameDownload.yaml.
Xbox Live Service Domains
This diagram shows the primary domains for Xbox services defined in Xbox.yaml.
Sources: Clash/Providers/Xbox.yaml:3-7
Game Download Domains
The GameDownload.yaml file specifies the exact hostnames for downloading game packages.
packagespc.xboxlive.comxvcf1.xboxlive.comxvcf2.xboxlive.comassets1.xboxlive.comassets2.xboxlive.com
Sources: Clash/Providers/Ruleset/GameDownload.yaml:16-20
Entertainment Platforms
The repository also includes comprehensive rules for popular media streaming services, primarily consolidated within ProxyMedia.yaml.
Twitch
Twitch rules are designed to capture traffic for the main site, its content delivery network (ttvnw.net), and related services.
| Rule Type | Value |
|---|---|
DOMAIN-SUFFIX | twitch.tv |
DOMAIN-SUFFIX | ttvnw.net |
DOMAIN-SUFFIX | jtvnw.net |
DOMAIN-KEYWORD | ttvnw |
Sources: Clash/Providers/ProxyMedia.yaml:328-332
YouTube
YouTube rules cover the main domain, its short URL service, content delivery networks, and related educational and kids' platforms.
# Source: Clash/Providers/ProxyMedia.yaml:374-389
# USER-AGENT,*youtube*
# USER-AGENT,YouTube*
# USER-AGENT,com.google.ios.youtube*
- DOMAIN-KEYWORD,youtube
- DOMAIN,youtubei.googleapis.com
- DOMAIN,yt3.ggpht.com
- DOMAIN-SUFFIX,googlevideo.com
- DOMAIN-SUFFIX,gvt2.com
- DOMAIN-SUFFIX,withyoutube.com
- DOMAIN-SUFFIX,youtu.be
- DOMAIN-SUFFIX,youtube-nocookie.com
- DOMAIN-SUFFIX,youtube.com
- DOMAIN-SUFFIX,youtubeeducation.com
- DOMAIN-SUFFIX,youtubegaming.com
- DOMAIN-SUFFIX,youtubekids.com
- DOMAIN-SUFFIX,yt.be
- DOMAIN-SUFFIX,ytimg.com
Sources: Clash/Providers/ProxyMedia.yaml:374-389
Summary
The Gaming & Entertainment rules within the Self-Rule project provide a detailed and service-specific approach to traffic management. By using a combination of dedicated rule provider files (.yaml) and system-level bypasses in the main configuration, the project ensures that traffic from gaming clients, download services, and media platforms is routed for optimal performance. These configurations are essential for users who need to differentiate between traffic that should go through a proxy and traffic that requires a direct connection, such as game downloads from regional CDNs.