Why GitHub times out through Clash

If you searched for “GitHub timeout with Clash,” “Git clone hangs behind proxy,” or “GitHub downloads fail in Clash Verge Rev,” you are probably seeing one of several different network problems that happen to produce the same symptom. A browser may display a spinning tab, git clone may stop after resolving a repository, a release download may remain at zero bytes, or an API request may return only after a long delay. These failures do not automatically mean that GitHub is down or that your subscription has expired.

GitHub traffic crosses several layers: DNS resolution, TCP or TLS connection setup, Clash rule matching, the selected proxy node, and sometimes a separate path for large assets hosted on a content delivery network. A profile can route github.com correctly while sending raw.githubusercontent.com, objects.githubusercontent.com, or a release asset host through DIRECT. The result is an account page that loads while raw files, repository cloning, or downloads time out.

This guide uses a practical troubleshooting loop for Clash Verge, Clash Verge Rev, Mihomo, and similar Clash clients. The objective is not to force every connection through a proxy. Instead, you will identify the failing hostname, confirm which rule and mode were used, test DNS and node health separately, and make the smallest configuration change that restores the required GitHub function.

Classify the failure before changing rules

Start by recording exactly what fails. “GitHub does not work” is too broad to guide a useful change. Open one repository page, one raw file, one release page, and one small release asset if your task depends on downloads. Note whether the failure is immediate, intermittent, or limited to a particular network. Also check whether the same address works when Clash is temporarily paused. This comparison is valuable, but it should be treated as a diagnostic test rather than a permanent solution.

Observed symptom Likely layer First check
Repository page loads, raw file times out Rule coverage or DNS policy Inspect raw.githubusercontent.com in Connections
Everything fails on one node but works on another Node reachability or remote filtering Switch only the proxy node and repeat the test
Browser works, Git CLI hangs Environment or application proxy settings Check git config --global --get-regexp proxy
Hostname fails, numeric or alternate test behaves differently DNS resolution, fake IP, or TLS path Compare resolver results and Clash DNS mode
Small files work, large assets stall Node congestion, timeout, or CDN route Test a different node and inspect asset hostnames

A useful distinction is whether the request reaches GitHub at all. An HTTP error such as 403 or 429 means a server responded; a connection timeout, reset, or endless TLS handshake points more strongly toward routing, transport, DNS, or node quality. Authentication errors from GitHub are also different. Invalid credentials, expired tokens, and repository permissions cannot be repaired by changing a Clash proxy group.

Keep corporate, school, or workplace policy in mind during diagnosis. Some networks deliberately restrict developer platforms, and some organizations require an approved proxy rather than a personal relay. The technical checks below help locate the failure; they do not override an acceptable-use policy or access control.

Inspect Clash mode, rules, and live connections

The fastest place to begin is the client’s live connection panel. In Clash Verge Rev or another Mihomo-based client, open Connections or Logs, then reproduce one failure in a new browser tab or terminal command. Search for the hostname rather than looking only for the word “GitHub.” Record the process name, destination domain, destination port, matched rule, final policy, and selected proxy group. Those fields tell you whether the request used a relay, went DIRECT, or was rejected before a connection was established.

GitHub commonly involves more than the main website. Depending on the action, inspect these host families:

  • github.com for repository pages, sign-in, settings, issues, and pull requests.
  • api.github.com for API clients, release metadata, automation, and some command-line workflows.
  • raw.githubusercontent.com for raw configuration files, scripts, manifests, and copied file URLs.
  • objects.githubusercontent.com and github-releases.githubusercontent.com for release objects and large downloads when those names appear in the log.
  • codeload.github.com for archive downloads such as ZIP or TAR source packages.
  • github.githubassets.com or other asset domains for JavaScript, stylesheets, and page resources.

Do not paste all of these domains into a permanent rule without observing your own traffic. GitHub can change delivery paths, and an overly broad rule may route local or unrelated services through a slow node. The log from a current failed request is better evidence than a list copied from an old tutorial.

Next, compare modes. In Rule mode, the profile decides the path for each request. In Global mode, the selected proxy is used broadly, which can temporarily confirm that a rule or GEOIP decision is wrong. In Direct mode, Clash may still be running while GitHub traffic bypasses the proxy entirely. If GitHub works immediately in Global mode but fails in Rule mode, focus on rule ordering and DNS classification instead of repeatedly changing nodes.

Rule order matters because Clash normally applies the first matching rule. A broad rule such as GEOIP,CN,DIRECT, a final MATCH,DIRECT, or a provider rule placed above your intended GitHub rule can send traffic away from the proxy. Put a narrowly scoped policy before broad catch-all decisions, then reload the profile. Avoid editing a generated subscription directly if the client will overwrite it during the next update. Use an override, local patch, or provider rule mechanism when available.

Hands-on repair: test DNS, node, and application paths

Use the following sequence rather than making several changes at once. A controlled sequence preserves the evidence needed to identify the real cause. Before starting, save a copy of the active profile or note the current override settings. If you use a remote subscription, avoid exposing its URL in screenshots, terminal history, or support tickets.

  1. Confirm the client is actually active.

    Check that the profile is enabled, the intended mode is selected, and the system proxy or TUN permission is active when your test application requires it. A browser may use the system proxy while a terminal process does not. Conversely, TUN mode can capture applications that ignore system proxy settings, but it may introduce DNS or firewall interactions that deserve separate testing.

  2. Test one hostname at a time.

    Open https://github.com and then request a known raw URL. In the Connections panel, verify whether both destinations receive the expected policy. If the first uses a proxy and the second uses DIRECT, the problem is rule coverage rather than general GitHub availability. Repeat with the API or release host only if your workflow uses it.

  3. Compare a small request and a large request.

    A small raw file or API response can reveal basic reachability without waiting for a multi-hundred-megabyte archive. If small requests succeed but release assets fail, inspect the final CDN hostname and test another node. Large transfers expose congestion, idle timeouts, packet loss, and bandwidth limits that ordinary page loads may hide.

  4. Check DNS behavior.

    Look at the resolved address shown by the client and compare it with a normal resolver result. Fake-IP, redirection, encrypted DNS, and local DNS interception can produce inconsistent results when the browser, Git, and Clash use different resolvers. Do not assume that changing DNS always improves the route. First determine whether the request is failing during name resolution or after a connection to the resolved address has started.

  5. Switch one proxy node.

    Keep the same mode and rules, then move from the current node to a nearby, less congested node. If the timeout disappears, the profile may be correct and the original node may be overloaded, filtered, or unable to sustain GitHub’s CDN connections. If every node fails in the same way, return to rules, DNS, or application settings instead of cycling through dozens of servers.

  6. Test the Git client independently.

    Run a verbose request from the same shell that launches Git. For example, inspect the route with curl -I -v https://github.com. The command is useful because it exposes proxy negotiation, DNS, TLS, redirects, and response headers. A browser result cannot prove that Git inherits the same path.

  7. Remove stale Git proxy settings before adding new ones.

    Git can retain an old proxy address even after Clash changes its mixed port. Review global and repository-level settings, as well as HTTP_PROXY, HTTPS_PROXY, and lowercase equivalents. A stale port often creates a fast “connection refused” error, while a wrong hostname or chained proxy can look like a timeout. Configure only the layer your environment needs, and verify it with a fresh clone.

Common local ports vary by client and profile, so never copy a port number blindly. Read the active Clash dashboard or configuration first. A mixed port normally accepts HTTP and SOCKS-style client traffic according to the client’s design, while a SOCKS-only port requires a compatible application setting. If you run both another VPN and Clash, check for port conflicts, competing TUN interfaces, and firewall rules that intercept the same traffic.

After each change, close the old connection and create a new one. Persistent HTTP/2 pools, browser connection reuse, Git credential helpers, and DNS caches can make a fixed route appear broken. Restarting only the failed tab may not be enough; restart the relevant command, browser process, or Clash connection view while keeping the profile unchanged.

Build a stable GitHub rule without over-routing

Once the failing host is known, prefer a narrow policy that covers the observed GitHub workflow. A domain-suffix rule for GitHub-related hosts can be appropriate when your provider and network policy allow it, but it should be placed before broad final rules and assigned to a healthy proxy group. If your profile uses rule providers, check whether a provider update has changed the order or replaced a local override. A successful manual edit that disappears after subscription refresh is not a stable repair.

Choose a proxy group rather than hard-coding one fragile node when possible. A group with health checks can move away from an unavailable endpoint, but health checks do not guarantee that a node performs well for long GitHub downloads. Review latency, packet loss, sustained throughput, and connection stability. A node with the lowest ping may still be poor for TLS streams or CDN transfers. Conversely, a slightly slower node with consistent throughput can make cloning and release downloads much more reliable.

DNS settings deserve the same restraint. If fake-IP mode causes an application to mishandle returned addresses, use the client’s documented compatibility options or a targeted fake-IP filter rather than disabling all DNS protection immediately. If encrypted DNS is blocked by the local network, test an approved resolver path and observe whether resolution completes before the TCP request. The correct setting depends on the client version, operating system, and network, so document the change and its observed effect.

For command-line work, decide whether you want application-level proxying or transparent capture. Application-level settings are easier to audit and affect only Git, curl, or a package manager. TUN mode can help tools that ignore proxy variables, but it also captures more traffic and may change local service discovery, container access, or private repository behavior. Use NO_PROXY for approved internal domains only when you understand which hostnames should remain local. A careless wildcard can silently bypass the route you are trying to test.

Security matters during every workaround. Do not disable TLS verification in Git, curl, or a package manager merely because a handshake fails. Do not install an unknown certificate or run a random shell command copied from a forum to “fix” GitHub. A proxy troubleshooting change should preserve certificate validation, protect access tokens, and leave an auditable explanation of why a domain was routed through a particular policy.

Finally, write down the working state: client and Mihomo version, profile revision, mode, DNS mode, proxy group, tested hostnames, and the exact command that succeeded. This small incident record makes future failures faster to classify. If a subscription update breaks GitHub again, you can compare the new rules and node assignments rather than starting from a blank screen.

A repeatable checklist for future timeouts

When GitHub stops responding again, begin with the shortest useful loop: reproduce one action, identify the exact hostname in Connections, note the matched rule and policy, compare Rule with Global mode, test a second node, and inspect DNS only if the evidence points there. Then test the application that actually failed. A browser success does not validate Git, a successful repository page does not validate release assets, and a working node does not prove that every rule is correct.

  • Keep the active Clash profile and subscription revision recorded.
  • Check github.com, api.github.com, raw content, and asset hosts separately when relevant.
  • Confirm that the first matching rule is the intended one.
  • Use Global mode only as a diagnostic comparison, not as proof that every destination should be proxied.
  • Change one node, DNS option, or rule at a time.
  • Verify Git’s own proxy configuration and inherited environment variables.
  • Preserve TLS verification and redact tokens from logs or screenshots.

Compared with simpler VPN clients that expose only an on/off switch, Clash can require more attention because it reveals separate rules, DNS decisions, proxy groups, and application paths. That extra visibility is also its practical advantage: instead of guessing whether GitHub is down, you can see that a raw file went DIRECT, a release asset used a congested node, or Git ignored the system proxy entirely. If you want that level of control across browsers, Git, and other developer tools, choose the client that matches your platform and continue with a documented, observable configuration.

Download Clash for free and browse freely →