International online courses rarely use a single website or a single network path. Coursera may load course pages from one group of domains, play video from another, and authenticate through a separate identity service. edX, Udemy, and MIT OpenCourseWare have similar arrangements, while payment pages, local search engines, software updates, and ordinary domestic websites may work better without a proxy. A useful Clash setup should therefore route education services through a suitable proxy while keeping unrelated traffic direct.
This guide explains how to build that split-routing workflow with Clash or a Mihomo-based client such as Clash Verge Rev, Mihomo Party, or another maintained graphical client. The examples focus on domain rules, proxy groups, DNS behavior, TUN mode, and practical testing. Domain names and service infrastructure can change, so treat the lists below as starting points rather than permanent guarantees.
Clash Online Learning Setup: Coursera, edX & Udemy Guide
Map the traffic used by each learning platform
Before editing rules, identify what you actually need to access. A course platform normally contains more than its visible homepage. The browser may contact a login provider, an API endpoint, a content delivery network, a video service, an analytics endpoint, and a payment processor during one session. If only the main hostname is routed through Clash, the page may open while login, subtitles, progress synchronization, or video playback fails.
Coursera commonly uses the main coursera.org domain together with subdomains and external content delivery services. edX uses edx.org and may load course assets from separate providers. Udemy uses udemy.com, but video delivery and static resources can be hosted on additional domains. MIT OpenCourseWare is generally available from ocw.mit.edu, although embedded media and external document hosts may follow different paths. These arrangements are not fixed, and a provider may add or remove domains without notice.
The most reliable method is to open the course platform, start a representative lesson, and inspect the Clash connection log. Record the domain, matched rule, policy group, and final node. Repeat the test for login, a video lesson, a PDF download, subtitles, and course progress synchronization. Do not copy every domain shown in the log automatically. Some entries are advertising, telemetry, fonts, or general-purpose services that do not need proxy access.
Course domain
The visible platform domain used for browsing catalogs, opening lessons, and managing an account.
CDN host
A separate host that serves video segments, images, scripts, subtitles, or downloadable documents.
Policy group
The rule target that chooses a proxy node, a direct connection, or a reject action.
Use the browser’s developer tools only as a supplement. The browser may display requests that do not represent all traffic from the operating system, and a TUN-enabled client may also capture connections from applications outside the browser. The Clash connection log is the better source for confirming which traffic entered the active core and which rule handled it.
Choose system proxy or TUN mode deliberately
System proxy mode is the simplest place to begin. When enabled, Clash writes an HTTP or SOCKS proxy address into the operating system’s proxy settings. Applications that respect those settings usually send browser traffic to the local Clash port. This mode is easy to inspect and has limited impact on other applications, but programs that ignore system proxy settings can continue to connect directly.
TUN mode creates a virtual network interface and allows the Clash or Mihomo core to intercept a broader range of traffic. It is useful when a course application, video player, terminal tool, or desktop client does not honor the system proxy. TUN normally requires administrator or system permissions, and its behavior depends on the client, operating system, DNS mode, and routing implementation. A TUN switch is not a substitute for correct rules: once more traffic enters Clash, inaccurate rules can affect more applications.
For a browser-only learning workflow, test system proxy mode first. Open Coursera, edX, Udemy, or MIT OpenCourseWare and confirm that the requests appear in the Clash log. If the browser works but a separate desktop application does not, enable TUN only after checking whether the application has its own proxy setting. On Windows, also check whether another VPN, security product, or virtualization tool has installed a competing network adapter. On macOS and Linux, check for other transparent proxy services and route managers.
mixed-port: 7890
allow-lan: false
mode: rule
log-level: info
ipv6: false
This is a structural example, not a universal replacement configuration. The active client may use another port, may generate these fields automatically, or may store them in an override layer. If the system proxy points to port 7890 but the current core listens on 7891, the browser will fail before any education rule can be evaluated. Confirm the port in the client’s settings and in the running connection log.
Build a focused education rule set
Clash evaluates rules from top to bottom. The first matching rule wins, so the education rules must appear before broad rules such as GEOIP,CN,DIRECT or a final MATCH,DIRECT. If a general direct rule appears first, a later Coursera or Udemy rule will never be reached. If a broad proxy rule appears first, domestic traffic may be sent through the proxy unnecessarily.
A small manually maintained rule set can look like this:
proxy-groups:
- name: Education
type: select
proxies:
- Course Auto
- DIRECT
- Japan
- Singapore
- United States
- name: Course Auto
type: url-test
url: http://www.gstatic.com/generate_204
interval: 300
tolerance: 80
proxies:
- Japan
- Singapore
- United States
rules:
- DOMAIN-SUFFIX,coursera.org,Education
- DOMAIN-SUFFIX,edx.org,Education
- DOMAIN-SUFFIX,udemy.com,Education
- DOMAIN,ocw.mit.edu,Education
- DOMAIN-SUFFIX,mit.edu,Education
- GEOIP,CN,DIRECT
- MATCH,DIRECT
The names in this example must match the actual proxy names in the imported configuration. If the subscription calls a node “JP 01” rather than “Japan,” referencing “Japan” creates an invalid group or an unavailable selection. A group can also use a provider instead of listing individual nodes, but the provider syntax depends on the core and configuration format supplied by the client.
Use domain rules carefully
DOMAIN-SUFFIX,coursera.org,Education matches the main domain and its subdomains, while DOMAIN,ocw.mit.edu,Education matches one exact hostname. Use DOMAIN-SUFFIX,mit.edu,Education only when you have verified that related MIT hosts require the same route. It may cover more traffic than intended. A narrower rule is easier to audit and reduces the chance of routing unrelated university services through the proxy.
Do not add a guessed CDN domain merely because its name looks international. First observe it while playing a lesson or downloading a document. Some CDN hostnames are shared by many websites; routing an entire suffix through a proxy could affect unrelated services. When a provider publishes a maintained rule set or domain list, review its source and update behavior before importing it. A rule provider that refreshes automatically is convenient, but it can also change routing without an explicit manual edit.
The final fallback is a policy decision. MATCH,DIRECT keeps everything not listed above direct. MATCH,Proxy sends all unmatched traffic through a proxy and is easier to make work initially, but it sends much more data through the proxy and makes troubleshooting less precise. For split tunneling, direct fallback is usually the clearer baseline.
Apply the configuration and test one course workflow
Make changes in the layer that the client will preserve. A subscription-generated YAML file may be overwritten during the next update, so direct edits can disappear. Prefer the client’s override, merge, rule-provider, or script feature when available. If you maintain a local configuration, keep a backup before changing ports, DNS, or proxy groups.
- Import or open the active configuration in Clash Verge Rev or another Mihomo-compatible client.
- Confirm that the selected core supports the fields used by the configuration, especially
rule-providers, TUN options, and the chosen DNS settings. - Check the local HTTP, SOCKS, or mixed port and enable only the intended system proxy mode.
- Reload the configuration rather than assuming that saving the file changed the running core.
- Open one platform, sign in, browse the catalog, start a video, switch subtitles, and download a small course document.
- Review the connection log after each action and record the matched rule and selected proxy group.
- Test an unrelated domestic website and a local service to confirm that they still use
DIRECT.
For each request, check four facts: whether the domain entered Clash, which rule matched, which policy group was selected, and whether the connection completed. A green connection entry alone does not prove that the platform is fully usable. A page may load from cache while new video segments fail, or the login request may succeed while a media host is blocked.
If video playback stalls, pause and resume once while watching the log. A successful playback request should produce new connections to the media delivery host. If the media host is direct while the course page uses the proxy, add only the verified host or a sufficiently narrow suffix. If the media host uses QUIC over UDP and the current setup handles only TCP proxy traffic, temporarily disable HTTP/3 or QUIC in the browser for testing. If playback then works over HTTPS, the issue may be UDP handling rather than the domain rule itself.
Test downloads separately from streaming. A PDF may use the platform domain, an object-storage hostname, or a signed temporary URL. Do not expose or publish signed URLs from the connection log. They can contain account or expiration information. Record only the hostname needed to understand the route.
Select nodes for video, authentication, and downloads
The fastest node is not always the best node for online learning. A course session may remain open for an hour, fetch many small video segments, refresh authentication tokens, and upload progress periodically. Stability, packet loss, and consistent latency can matter more than a single speed-test result.
Create a dedicated Education group instead of reusing a global “Proxy” group whose selection changes whenever another application is tested. A select group gives you manual control when a platform behaves differently across regions. A url-test group can automatically choose a responsive node, but its probe URL measures access to the probe destination, not the complete Coursera, edX, Udemy, or MIT OpenCourseWare workflow.
- Use a nearby stable region first. Japan, Singapore, Hong Kong, or another nearby location may provide lower latency, but the optimal region depends on the service and the network path.
- Keep a second region available. A course platform may return different authentication or media endpoints based on the exit IP.
- Avoid constant switching during playback. Changing nodes can invalidate sessions, interrupt segment downloads, or trigger additional account verification.
- Compare sustained behavior. Watch at least five to ten minutes of video and try a document download instead of relying only on a latency number.
- Use a separate group for sensitive account traffic when needed. Authentication and payment requests should not be sent through an unstable or frequently changing node.
Some education services restrict access by region or detect unusual changes in IP location. Clash rules cannot remove an account-level restriction, and switching among many countries may create more verification challenges. Choose a region that is permitted for your account and keep it consistent during a course session. Do not assume that a node labeled with a country name is physically located there or that its address will remain unchanged.
Handle DNS, TUN, and split-routing edge cases
DNS behavior can make a correct rule appear broken. With normal system proxy mode, the operating system or browser may resolve a hostname locally before sending the request to Clash. With TUN and enhanced DNS modes, the Mihomo core may handle DNS itself, use fake-IP responses, or apply separate nameserver and fallback policies. These modes affect which address an application sees and when a domain can be matched.
If a platform opens but directs you to an unexpected regional endpoint, inspect the DNS mode and the rule order before changing nodes repeatedly. A DNS request resolved through a local resolver may return a region-specific address, while a remote resolver may return another result. This does not mean that one resolver is universally correct; it means the resolver, exit region, and service policy are part of the complete routing path.
Fake-IP mode can simplify domain-based routing because the core keeps a mapping between the synthetic address and the original hostname. Some applications, security tools, and local network services do not handle fake IP well. If a course application shows certificate errors, cannot open a document, or connects to a numeric address that is difficult to classify, test the same workflow with a compatible redir-host or enhanced DNS setting supported by the installed core.
When TUN is enabled, exclude local networks and important private ranges according to the client’s supported settings. A learning setup should not accidentally route printers, routers, NAS devices, or local development services through an external proxy. Keep allow-lan: false unless other devices genuinely need to use the local Clash instance. If LAN access is enabled, bind it to a trusted interface and protect the external controller with an appropriate secret.
dns:
enable: true
enhanced-mode: fake-ip
nameserver:
- https://1.1.1.1/dns-query
- https://dns.google/dns-query
fake-ip-filter:
- "*.lan"
- "*.local"
This DNS block is illustrative only. Resolver availability, privacy requirements, local network behavior, and the core version all matter. Do not paste a DNS example into a subscription override without checking whether the client already manages DNS, whether the resolver is reachable from the current network, and whether local hostnames must remain excluded.
Maintain the setup without over-routing traffic
After the initial setup works, keep a small record of the domains that required proxy access, the rule that matched, and the node group that performed well. Review that record when a subscription updates or a platform changes its player. Remove domains that no longer appear in current tests. A shorter rule list is easier to understand and less likely to capture unrelated traffic.
When a page fails, start with the narrowest diagnosis. If no connection appears in the Clash log, the application is bypassing the selected proxy path, another client is active, or the existing connection was reused. If the connection appears with DIRECT, inspect rule order and the exact hostname. If the correct group is selected but the request fails, test another node and check DNS, TLS, UDP, and regional restrictions. If only one media host fails, do not replace the entire rule set immediately.
- Login fails: check the identity provider and authentication domains, not only the course homepage.
- Video fails: inspect newly created media or CDN connections and test QUIC versus TCP behavior.
- Documents fail: record the download hostname and check whether the signed URL expires quickly.
- Progress does not sync: inspect API requests, browser extensions, and blocked background connections.
- Domestic sites become slow: check whether a broad proxy rule appears before direct or education-specific rules.
- TUN breaks local services: review private-network exclusions, fake-IP filters, and competing virtual adapters.
Update the core and client through trusted distribution channels, but do not change several variables at once. If a new Mihomo version, DNS mode, node subscription, and rule provider are introduced simultaneously, a later failure becomes difficult to attribute. Change one layer, reload the configuration, and repeat the same course workflow.
A well-designed online-learning configuration is intentionally selective. Coursera, edX, Udemy, and MIT OpenCourseWare receive a dedicated policy because their pages, APIs, and media may require a reliable international route. Everything else remains subject to your normal direct-routing rules unless testing proves otherwise. This approach reduces proxy load, preserves local access, and gives you a clear log trail when a platform changes its network structure.