Preface
Online courses can depend on more than one website. You might watch a lecture, open a quiz, download a reading, and sign in to a learning platform within a few minutes. If some of those requests fail or load slowly, routing every connection through a proxy is not necessarily the best fix. A broad proxy setting can also send local websites, banking pages, and other everyday traffic through a distant server for no benefit.
Clash gives you more precise control. You can route Coursera and edX through a proxy group while leaving ordinary local browsing on a direct connection. The key is to use narrow domain rules, put them in the correct position in the rules list, and confirm the result in the client’s connection log. This guide uses Mihomo-compatible YAML examples; menu names vary between Clash Verge Rev, other Clash clients, and core versions.
The Goal
Route the course-platform domains you need through a selectable proxy group, keep unrelated and local traffic on its existing route, and verify each decision before relying on it for a class.
1Choose a Routing Strategy Before Editing
Start by deciding what problem you are trying to solve. If Coursera or edX is unavailable on your current network, a proxy rule may help. If the platform already works but video buffers, switching to a closer or less congested node may be more useful than adding more domains. A rule only determines which policy handles a matching connection; it cannot make an overloaded node fast or correct an account, browser, or service-side problem.
For most users, a dedicated selector group is easier to manage than sending course traffic to a fixed server. A selector lets you change nodes from the client interface without rewriting the rules. If your configuration already has a suitable group, you can point the rules to it instead of adding another one. Group names are literal: the policy in a rule must match a group name in the active configuration exactly.
| Approach | What it does | When it fits |
|---|---|---|
| Dedicated selector | Routes matching course traffic to a group where you choose a node. | Useful when you want to switch nodes without changing rules. |
| Existing proxy group | Uses a provider’s existing group, such as a region or general proxy selector. | Best when your subscription already supplies a reliable group. |
| DIRECT | Connects without using a proxy. | Appropriate when the platforms work well on your direct connection. |
| Global proxy mode | Sends most or all traffic through the selected proxy, depending on the client. | Useful only as a short diagnostic comparison, not as a precise course-only setup. |
Keep the Scope Small
Begin with the platform’s main domain suffixes. Add an extra domain only after the connection log shows that a required course resource is matching a different host and needs a different route.
2Understand Course-Platform Domain Rules
Clash evaluates rules from top to bottom and uses the first matching rule. A DOMAIN-SUFFIX rule can match a base domain and its subdomains. For example, DOMAIN-SUFFIX,coursera.org,Learning can match both coursera.org and a host such as www.coursera.org. The same pattern is useful for the main edX domain.
Here is a minimal example of course-platform rules:
These rules route matching hostnames to the policy named Learning. They do not guarantee that every image, video, identity provider, or other embedded resource uses one of these domains. Large services may load content from additional hosts, and those hosts can change. Avoid copying long domain lists from an unrelated configuration: a rule that is too broad can affect other services, while an outdated host may do nothing at all.
For a new or carefully controlled configuration, a selector group could look like this:
Replace Your Existing Proxy Group with a real policy name already present in your configuration. If the group is not defined, Clash may report an invalid configuration or an unknown policy. In a provider-managed subscription, the group and proxy names may be generated automatically. In that case, use an existing group in the rules rather than pasting this example over the subscription’s own proxy-groups section.
Do Not Replace Your Whole Profile
A subscription profile may contain server credentials, DNS settings, rule providers, and groups. Back it up before editing, and make the smallest change your client supports. If the subscription is refreshed, local edits may be overwritten.
3Add and Test the Rules in Your Client
The exact controls differ by application, but the workflow is similar in Clash Verge Rev, Clash Verge, and other Mihomo-based clients: identify the active profile, make a backup, edit or extend its rules, validate the profile, and reload it. Do not edit an inactive profile and assume the running client has changed.
- Confirm the active profile. In the client, check which configuration is currently running. Export or copy it somewhere safe so you can restore the original if a syntax error occurs.
- Find the rule list. Open the profile editor or the client’s supported rule override area. If your configuration uses a separate rules provider or merge mechanism, follow that structure rather than adding a second conflicting
rules:key. - Check the policy name. Identify a valid existing proxy group, or create a selector only if you control the relevant configuration. Use the same spelling and capitalization in the group and each rule.
- Add the platform rules near the top. Put the Coursera and edX entries above broad rules that could match first. Keep them above the final catch-all rule, commonly
MATCH. - Validate and reload. Save the edit, use the client’s configuration check if available, and reload the active profile. If the client reports an unknown policy, malformed YAML, or duplicate key, restore the backup and correct the specific error.
- Choose a node and test. Select a suitable option in the
Learninggroup, then open the learning platform in a fresh browser tab. Test sign-in, a course page, and a lecture or reading you actually need.
A complete rules list might contain entries like these, followed by your existing rules:
This is an excerpt, not a replacement for your full configuration. Preserve existing entries that handle local domains, private IP ranges, advertising, or other services. If a particular local site must remain direct, its more specific direct rule should be ordered so it is evaluated before any broader rule that would otherwise capture it. Do not add a generic rule that sends all education, video, or cloud-provider traffic through the proxy just to make one lecture load.
4Keep Local Browsing and Other Traffic Direct
Rule-based routing is valuable because the course-platform rules do not have to change the route for every other connection. If your profile already includes local-network or country-specific direct rules, leave them in place and confirm their position relative to the platform entries. Private addresses such as local network devices should normally continue to use the profile’s existing direct-routing logic.
Be cautious with broad rules such as DOMAIN-KEYWORD,course, DOMAIN-SUFFIX,com, or a catch-all proxy rule. They can match far more than Coursera or edX. A narrow suffix rule is easier to reason about and easier to remove if a test produces unexpected results.
If you want the platforms to use a proxy but want the option to connect directly, keep DIRECT as an option in the selector where your configuration permits it. You can then compare routes without changing the rule. If the direct option is unavailable or the platform does not work on it, select an appropriate proxy and test again. Follow local laws, institutional network policies, and the terms of the services you use.
Avoid Unnecessary DNS Changes
A domain-routing change does not automatically require changing DNS mode, nameservers, or fake-IP settings. Adjust DNS only when you have a specific DNS issue to diagnose, and understand how the active profile handles DNS before editing it.
5Verify the Route and Troubleshoot Failures
A page loading successfully does not prove that the intended rule matched. Use the client’s Connections, Logs, or equivalent view while opening a course page. Find the relevant hostname, inspect the matched rule or policy when shown, and confirm that the connection uses the expected Learning group or selected proxy. Client interfaces differ, so consult the application’s own labels rather than assuming every connection view displays the same details.
Test several types of course activity instead of checking only the homepage: sign in, open a course lesson, play a lecture, load a quiz, and download a permitted resource. This helps identify whether the main site works while a separately hosted asset or media request follows another route. If a resource fails, inspect its actual hostname in the connection log before adding a new rule. Add only the narrow host rule you can justify, then repeat the same test.
- The site does not open: Check whether the active profile reloaded successfully, whether the chosen node is reachable, and whether the browser has stale site data. Compare with another node or a direct connection if appropriate.
- The homepage opens but a lecture does not: Inspect failed or repeatedly reconnecting hosts while starting the video. The media host may differ from the main platform domain; verify it in the log before changing rules.
- The wrong policy appears: Check rule order, spelling of the group name, and whether a higher-priority rule matched first. Confirm that your changes were made in the active profile.
- The configuration fails to load: Look for indentation errors, duplicate YAML keys, an undefined group, or a rule placed outside the
rules:list. Restore the backup if you cannot identify the problem quickly. - Other browsing changes unexpectedly: Remove broad keyword or catch-all edits and compare against the backup. Keep only the platform-specific rules that solve the observed issue.
Once testing is complete, leave the selector on the node that performs reliably, or return to DIRECT if a proxy is unnecessary for your network. Recheck the rule after a subscription update, because provider refreshes can replace local modifications or rename policy groups. A small, documented change is easier to maintain than an unexplained list of domains.
For a client installation or another platform-specific starting point, view the download page.