Clash Setup For Researchers: Scholar, Zotero And Overleaf

Map the research workflow before writing rules

Academic work rarely depends on one website. A typical research session may begin with Google Scholar or another discovery service, continue through a university library catalogue, open publisher pages, download PDF files from an institutional repository, synchronize references with Zotero, and finish with a collaborative document in Overleaf. These services may use different domains, redirects, authentication providers, content delivery networks, and API endpoints. A rule that makes one search page open does not automatically make the complete workflow reliable.

Start by listing the actual services used in your workflow rather than creating a broad rule named “academic websites.” For example, separate discovery, publisher access, reference synchronization, cloud storage, identity login, and collaborative writing. This inventory helps you decide which traffic should use a proxy group and which traffic should remain direct. It also makes later troubleshooting much easier because every connection can be associated with a functional category.

Research task Typical traffic Recommended first policy What to verify
Literature discovery Scholar search, DOI pages, indexing services Academic proxy group Search results, redirects, and CAPTCHA pages
Full-text retrieval Publisher domains, repository hosts, PDF CDNs Academic proxy group or direct by institution PDF download and stable connection reuse
Reference management Zotero sync, WebDAV, translators, attachment URLs Dedicated sync group Sync status, metadata, and attachment upload
Collaborative writing Overleaf editor, project API, compile and preview services Writing and collaboration group Login, autosave, compilation, and PDF preview

There is also an important boundary between network routing and account access. Clash can select a route for a connection, but it cannot replace a university subscription, bypass a publisher’s access controls, or correct an expired institutional login. Use only services and materials that you are authorized to access, and treat proxy configuration as a connectivity tool rather than an access-rights mechanism.

Choose a suitable Clash client and operating mode

The graphical client and the proxy kernel perform different jobs. Clash Verge Rev, Mihomo-based clients, and other maintained interfaces provide configuration management, system proxy controls, logs, and sometimes TUN integration. The kernel parses the YAML file, opens local ports, resolves domains, matches rules, and connects to the selected proxy node. When a research tool behaves unexpectedly, check both layers: the client may show that a configuration is active while the kernel may reject an unsupported field or fail to establish a connection.

For a desktop research workstation, begin with the system proxy mode. It is easier to inspect because browsers and many desktop applications read the operating system’s HTTP or SOCKS settings. Enable the system proxy from the client, then confirm the effective HTTP or mixed port. This mode is often sufficient for browser research, DOI lookups, and web-based Overleaf use.

TUN mode can capture applications that ignore the system proxy, including some reference managers, document tools, command-line programs, and background synchronization processes. However, TUN is not simply a stronger system-proxy switch. It requires elevated permissions or a system extension, changes how DNS and routes are handled, and may interact with institutional VPNs, endpoint security software, virtualization, or local network discovery. Enable it only after the ordinary proxy path is understood.

Browser and web applications

SYSTEM PROXY

Routes programs that respect the operating system’s HTTP or SOCKS settings. It is the simplest starting point for Scholar, publisher pages, and browser-based Overleaf work.

Applications that ignore proxy settings

TUN

Creates a virtual network interface so more traffic can enter the Clash kernel, but it requires careful DNS, permission, and VPN compatibility checks.

Local diagnostics

CONNECTION LOG

Shows the destination, matched rule, policy group, and connection status. It is the most useful place to confirm whether Zotero or Overleaf traffic reached Clash.

Do not run several proxy clients with overlapping system-proxy or TUN controls. A second client can overwrite the system proxy address, reserve the same port, install another virtual interface, or make logs appear inconsistent. Before testing a new setup, quit unrelated proxy applications and record the active client, kernel version, listening port, mode, and configuration name.

Build proxy groups for academic services

A single global proxy group is convenient but often produces poor results. Research destinations have different latency and reliability requirements. A search page benefits from a responsive route, a large PDF download benefits from sustained throughput, and Zotero synchronization benefits from a stable connection that does not change repeatedly during an upload. Overleaf editing is sensitive to interruptions because the browser maintains long-lived connections for project state, compilation, and preview updates.

Create functional groups when the client and kernel support them. A practical structure is an Academic group for discovery and publisher traffic, a Sync group for Zotero and WebDAV, and a Writing group for Overleaf and related collaboration services. Each group can contain a preferred node, a fallback node, and a direct option where appropriate. Avoid naming a group after a temporary node location; use a stable label that still makes sense when the subscription updates.

mixed-port: 7890
mode: rule
log-level: info

proxy-groups:
  - name: Academic
    type: select
    proxies:
      - Auto-Academic
      - DIRECT

  - name: Sync
    type: select
    proxies:
      - Stable-Sync
      - Academic
      - DIRECT

  - name: Writing
    type: select
    proxies:
      - Stable-Writing
      - Academic
      - DIRECT

This example describes group relationships only. The names in the proxies list must exist in the active configuration, and a subscription converter or client override may use different syntax. If the configuration is subscription-generated, place persistent changes in the client’s supported override or merge feature instead of editing a temporary downloaded file that will be replaced at the next update.

Use a select group while testing because it makes the chosen route explicit. An automatic URL-test group can be useful later, but the fastest node is not always the most dependable route for authentication, WebSocket connections, or large attachments. Test each function separately and note the result. A route that opens Google Scholar may still fail when Zotero uploads an attachment or when Overleaf compiles a project.

Write domain rules carefully and respect rule order

Clash and Mihomo evaluate rules from top to bottom. The first matching rule decides which policy receives the connection. A broad rule placed above a specific academic rule can therefore send traffic to the wrong group. For example, a generic global rule, a country-based rule, or a large provider may match a publisher domain before the intended DOMAIN-SUFFIX entry is reached.

Use domain-based rules where the destination is known. DOMAIN matches one exact hostname, DOMAIN-SUFFIX matches a domain and its subdomains, and DOMAIN-KEYWORD matches text within a hostname. Prefer the narrowest reliable expression. A keyword such as scholar can match unrelated hosts, while a suffix rule is easier to review and less likely to capture unintended traffic.

rules:
  - DOMAIN-SUFFIX,google.com,Academic
  - DOMAIN-SUFFIX,googleusercontent.com,Academic
  - DOMAIN-SUFFIX,zotero.org,Sync
  - DOMAIN-SUFFIX,overleaf.com,Writing
  - DOMAIN-SUFFIX,overleafusercontent.com,Writing
  - MATCH,DIRECT

The snippet is a starting pattern, not a complete universal list. Google Scholar may load assets from several Google hostnames, and a university or publisher may use a separate identity provider, library proxy, DOI resolver, or content delivery domain. Zotero can reach different endpoints depending on whether you are syncing library data, fetching metadata, uploading files, or using WebDAV storage. Overleaf may use additional service hosts for project operations and compilation. Check the connection log while performing one action at a time, then add only the domains that are genuinely required.

Keep the final MATCH rule visible. It is the fallback for destinations that did not match earlier entries. During diagnosis, assigning MATCH to a known policy can reveal whether missing rules are the problem, but a permanent broad proxy fallback may route unrelated traffic through the same path. After testing, decide deliberately whether unmatched traffic should be DIRECT, a general proxy group, or a reject policy according to your normal network design.

Use rule providers with care

Rule providers can keep large domain lists outside the main YAML file, but they introduce another dependency: the provider itself must download, parse, and refresh successfully. If a provider contains broad categories, inspect its order relative to your custom rules. Put explicit exceptions and essential academic destinations where they will be evaluated before broad category rules. When a provider update fails, the client may continue using a cached copy, which can make the behavior appear inconsistent with the current configuration.

Configure Google Scholar, Zotero, and Overleaf separately

Google Scholar: test search, redirects, and downloads

Google Scholar is primarily a browser workflow, so system proxy mode is usually the clearest first test. Open a fresh search, follow one result to a publisher or repository, and download a small document. These actions may involve different hostnames. If the search page works but a result does not, inspect the destination in the Clash connection log instead of assuming the Scholar rule failed.

Repeated requests can trigger rate limits, CAPTCHA challenges, or temporary restrictions that are not fixed by switching nodes repeatedly. Use moderate search behavior, avoid unnecessary automated requests, and keep browser extensions that alter search traffic disabled during diagnosis. A successful proxy connection does not guarantee that a third-party service will accept every request pattern.

Zotero: separate metadata, sync, and attachments

Zotero can involve several network operations: translating a web page into a citation, synchronizing library metadata, downloading or uploading attachments, and connecting to WebDAV storage. Test these actions independently. First confirm that the application can sign in and synchronize a small library change. Then test one attachment download and one upload. If metadata sync succeeds but attachments fail, the missing destination may belong to the storage provider rather than the main Zotero domain.

Do not expose the local Clash controller to the public network while trying to make Zotero work. The external controller port, commonly something such as 127.0.0.1:9090, is for local management and should be protected with a secret when enabled. A proxy port and a controller port are different: Zotero needs the former only when it is configured to use a proxy, while the latter should never be entered as an ordinary HTTP proxy endpoint.

Overleaf: preserve long-lived collaboration sessions

Overleaf combines browser authentication, project editing, autosave, compilation, and PDF preview. If the page loads but edits do not save, inspect whether the connection remains established in the client log. Frequent automatic node changes can interrupt long-lived sessions even when each individual latency test looks good. For collaborative writing, a stable group is often preferable to a group that changes nodes aggressively based on short measurements.

Test the complete sequence: sign in, open an existing project, edit a harmless line, save, compile, and download the resulting PDF. If only compilation fails, look for a separate service host in the log and verify whether the problem is a project build error rather than network routing. If the browser works but a local LaTeX workflow or command-line upload fails, configure that tool explicitly or use TUN after confirming that the virtual interface does not conflict with another VPN.

Symptom Likely boundary First diagnostic action
Scholar opens, publisher PDF fails Different destination or redirect Inspect the PDF host and add a narrow rule if necessary
Zotero metadata syncs, attachments do not Storage or WebDAV endpoint Test the attachment host separately
Overleaf loads, autosave disconnects Unstable route or long-lived session Use a stable group and review connection events
All browser traffic works, desktop app fails Application ignores system proxy Configure its proxy settings or evaluate TUN

Handle DNS, TUN, and university VPN conflicts

DNS behavior can make a correct proxy rule appear broken. With fake-IP or redirection-based DNS modes, the client may return synthetic addresses and later map them back to domains. Some institutional services, local printers, campus portals, and split-DNS zones require the university’s resolver or a direct route. If those services stop resolving after TUN is enabled, do not immediately add random domains to the proxy group. First determine whether the domain should use the campus DNS path and whether it belongs to a private address range.

A university VPN and Clash TUN may both attempt to control routes, DNS, or the default interface. Depending on the operating system and client, one may take precedence over the other, causing library proxy access, internal repositories, or authentication pages to fail. Test these combinations deliberately: university VPN alone, Clash system proxy alone, and both together if the institution permits it. Record the route and DNS behavior for each state.

Useful safeguards include keeping private networks direct, excluding local gateway addresses from proxy handling, and preserving access to internal domains through the institution’s documented method. The exact keys differ between Clash kernels and clients, so use the active kernel’s supported syntax rather than copying a TUN example from an unrelated version. A configuration that loads successfully can still behave incorrectly if a field is accepted but interpreted differently by another kernel.

dns:
  enable: true
  ipv6: false
  enhanced-mode: fake-ip
  fake-ip-filter:
    - "*.lan"
    - "*.local"
    - "localhost.ptlogin2.qq.com"

The example illustrates the shape of a DNS section, not a universal recommendation. Fake-IP filters should contain only domains that need special handling. Overly broad filters can send more requests to the operating system resolver and make routing results harder to predict. If a service fails, compare its behavior with DNS enabled and disabled only as a controlled diagnostic; keep the final setting based on the requirements of the applications and network.

Test the setup with repeatable checks

Use a fixed test sequence instead of changing several settings at once. Record the client name, kernel version, active configuration, mode, selected group, local port, DNS mode, and whether a university VPN is active. Then test one destination at a time. This creates a useful comparison when a subscription updates or a node provider changes.

  1. Confirm that the Clash kernel is running and that the expected HTTP, SOCKS, or mixed port is listening.
  2. Enable only the system proxy first and open a new Scholar search in a clean browser window.
  3. Follow a result to a publisher or repository and inspect the matched rule in the connection log.
  4. In Zotero, test login or metadata synchronization, then test one attachment separately.
  5. In Overleaf, open a project, save a harmless edit, compile, and verify the PDF preview.
  6. Repeat the failing action with a different node in the same functional group, not with a completely different configuration.

On the command line, use a request that explicitly names the local proxy port. For an HTTP or mixed port, the form is commonly:

curl -x http://127.0.0.1:7890 -I https://scholar.google.com
curl -x http://127.0.0.1:7890 -I https://www.overleaf.com

These commands test whether the local HTTP proxy accepts the request; they do not prove that every browser, Zotero operation, or Overleaf background service uses the same route. A successful response may also be an HTTP redirect, so inspect the status code and destination. If the command cannot connect to the local port, check the client listener first. If the local connection succeeds but the remote request fails, inspect DNS, the selected node, the matched rule, and the remote service response.

For Zotero and Overleaf, application logs can provide evidence that a failure is local rather than remote. A message about certificate validation, authentication expiry, project compilation, or a malformed WebDAV response should not automatically be treated as a Clash routing problem. Similarly, a browser CAPTCHA is a service response, not proof that the YAML parser or local proxy port is broken.

Common configuration mistakes

  • Wrong port: the operating system points to 7890 while the active client listens on another mixed port.
  • Wrong protocol: a SOCKS-only port is entered as an HTTP proxy, or an application requires a separate SOCKS5 setting.
  • Rule shadowing: a broad rule or provider appears before the intended academic domain rule.
  • Unsupported syntax: a field from Mihomo is copied into a client using a different kernel.
  • Stale configuration: the client is running an older profile while the edited YAML belongs to another profile.
  • Session instability: an automatic group changes nodes during authentication, synchronization, or compilation.
  • Duplicate control: another proxy client or VPN has changed the system proxy, DNS, or TUN route.

FAQ for Scholar, Zotero, and Overleaf users

Should all academic traffic use one proxy group?

Not necessarily. Search, attachment synchronization, and collaborative writing have different stability and bandwidth requirements. Start with one academic group for discovery and publisher pages, then create dedicated sync or writing groups if the logs show different endpoints or connection behavior.

Why does Google Scholar work while Zotero does not?

The browser may follow the system proxy while Zotero ignores it or uses a separate application setting. Zotero may also contact a sync, translator, attachment, or WebDAV endpoint that is not covered by the Scholar rule. Check the Clash connection log during a real Zotero sync and verify the application’s proxy settings.

Is TUN required for Overleaf?

Browser-based Overleaf usually works through the system proxy, so TUN is not automatically required. Consider TUN only when a local tool or application ignores the system proxy. Test it separately because TUN can conflict with university VPNs, DNS settings, and security software.

What should I do when a rule appears correct but access still fails?

Confirm that the active kernel loaded the rule, that the hostname matches the rule type, and that no earlier rule shadows it. Then inspect the selected node, DNS result, TLS or authentication error, and application log. A matched rule proves routing selection, not that the remote service will accept the request.

Download Clash