Clash Mixed-Port & LAN Sharing Setup: Route Phones and TVs Through One PC

How to enable mixed-port and allow-lan so phones, tablets, and TVs on your LAN can share your PC's proxy, plus key security tips.

If Clash is already running on your PC, there's no need to install a separate client on every phone, tablet, or TV in the house — just point those devices at the same nodes. Turn on mixed-port and LAN sharing, then have other devices connect to your PC's LAN IP. If you haven't installed a client yet, grab Clash Verge Rev from the download page, import your subscription following the setup guide, then come back and enable sharing.

Mixed-Port: One Port, Two Protocols

A Clash config file has three port-related fields — know the difference before you touch anything:

  • port: the HTTP proxy port, accepts only HTTP/HTTPS proxy requests;
  • socks-port: the SOCKS5 proxy port, supports both TCP and UDP forwarding;
  • mixed-port: a single port that auto-detects whether an incoming request is HTTP or SOCKS, so the client on the other end doesn't need to care about the protocol.

Clash Verge Rev enables only a single mixed port, 7897, by default (older versions and some legacy configs used 7890 — check the actual value under Settings → Port Settings). The system proxy, browser, and command-line tools all point to it. LAN sharing works the same way: on phones and TVs, you only need to remember one IP and one port number.

When would you need a separate port or socks-port? Mainly when an older app only understands one protocol and doesn't play well with auto-detection — you can declare it explicitly, since all three fields can coexist without conflict. For everyday sharing, mixed-port is all you need. See the config reference page for full field details.

Step 1: Enable allow-lan and Open Your Firewall

By default, Clash only listens on 127.0.0.1, meaning only the local machine can connect. The allow-lan field controls whether it listens on all network interfaces — set it to true and devices on the same LAN can start connecting.

In Clash Verge Rev, there's no need to edit any file by hand: open the Settings page, find the "LAN Sharing" toggle and turn it on — this maps directly to allow-lan. The same page's "Port Settings" lets you view or change the mixed port. The equivalent YAML looks like this:

mixed-port: 7897
allow-lan: true
bind-address: "*"

Leave bind-address as * (all interfaces) — hardcoding a specific IP tends to break the moment you switch networks.

The first time you enable sharing on Windows, Security Center usually pops up asking whether to allow verge-mihomo to communicate on networks — check "Private networks" and allow it. If you accidentally clicked Cancel, go to Control Panel → Windows Defender Firewall → Allow an app through the firewall, find the entry, and re-check Private. If macOS has its firewall on, allow the kernel binary under System Settings → Network → Firewall → Options.

Step 2: Find Your PC's LAN IP Address

The "server / hostname" field on other devices should be your PC's address on the LAN, not 127.0.0.1. Here's how to find it:

  • Windows: run ipconfig in Command Prompt and check the "IPv4 Address" under your active adapter, typically something like 192.168.1.20;
  • macOS: visible directly under System Settings → Wi-Fi → Details, or run ipconfig getifaddr en0 in Terminal;
  • Linux: run hostname -I in a terminal and take the first address.

This address is assigned by your router's DHCP and can change after a reboot or lease expiration. For long-term sharing, set up an IP/MAC reservation (often called "address reservation") in your router's admin panel to keep your PC's LAN IP fixed — otherwise you'll be re-entering it on your phone every few days.

Step 3: Configuring Phones, Tablets, and TVs

Prerequisite: the device and your PC must be on the same router and the same subnet. The examples below use PC IP 192.168.1.20 and port 7897.

iPhone / iPad

Go to Settings → Wi-Fi, tap the info button next to your current network, scroll to the bottom to "Configure Proxy," and choose "Manual": enter 192.168.1.20 as the server and 7897 as the port, then save. If you haven't set up authentication, leave the "Authentication" toggle off.

Android Phone / Tablet

Go to Settings → Wi-Fi, long-press (or tap) the connected network, choose "Modify network," expand "Advanced options," and set Proxy to "Manual": enter 192.168.1.20 as the proxy hostname and 7897 as the proxy port, then save. Wording varies slightly between manufacturers, but it's always under Proxy → Manual.

Android TV / Streaming Boxes

On stock Android TV: Settings → Network & Internet → current Wi-Fi → Proxy settings, choose Manual, then enter the IP and port. Note that many TV manufacturers' custom skins (some domestic Chinese TVs, older Samsung and LG models) don't expose a proxy option at all — in that case this approach won't work, and you'd need to push the proxy down to the router level, which is outside the scope of this guide.

Another Computer

On macOS, go to System Settings → Wi-Fi → Details → Proxies, check "Web Proxy (HTTP)" and "Secure Web Proxy (HTTPS)," and enter the same address and port. On Windows, go to Settings → Network → Proxy → Manual proxy setup. You can also scope this to just a browser extension for a smaller blast radius.

PC Off = Phone Offline

Once a phone has a manual proxy configured, nearly all its traffic gets routed through your PC. If the PC sleeps, shuts down, or Clash quits, the phone loses internet access immediately. When you're done sharing, remember to switch the phone's proxy setting back to "Off / None."

Verifying the Connection and Troubleshooting Order

The quickest way to verify from another device is the command line:

curl -x http://192.168.1.20:7897 -I https://www.google.com

Getting a response header back means the full chain — device → PC → node — is working. If there's no terminal on your phone, just opening a website in the browser tells you the same thing.

If it's not connecting, check these in order, from most to least likely cause:

  1. Are both devices on the same subnet? Your phone's IP should also be 192.168.1.x — a "guest network" connection is almost always isolated from the main LAN;
  2. Is AP isolation / client isolation enabled on the router? With it on, LAN devices can't see each other — turn it off and try again;
  3. Is the PC's firewall actually letting traffic through? Temporarily disable it to isolate the issue;
  4. Is allow-lan actually in effect? Check the kernel log for the listening line — the address should be [::] or 0.0.0.0; if it still shows 127.0.0.1, the toggle didn't take effect or the config wasn't applied;
  5. Is the port already in use by another program on the PC? If so, switch to a different one, e.g. 7899, and update it on the phone side too.
mihomo startup log
level=info msg="Mixed(http+socks) proxy listening at: [::]:7897"

Two more common gotchas: first, HTTP proxies don't forward UDP, so voice calls and some games may misbehave when routed through the system proxy — that's expected protocol behavior, not a misconfiguration; second, running another VPN-type app on the phone at the same time will conflict with a manual proxy, so disable it before testing.

Security Note: Don't Leave Sharing On Permanently

Only Share on Networks You Trust

Turning on allow-lan exposes your proxy service to every device on the current subnet. That's fine at home, but on public networks — coffee shops, airports, a company's guest Wi-Fi — keep it off.

A shared proxy gives whoever uses it the exact same network view as your PC: they can reach anything your PC can reach on the local network, including your router's admin panel. So even at home, only share the IP and port with people you trust.

For long-term sharing, add a username and password layer — Clash supports this natively:

authentication:
  - "homeuser:replace with a sufficiently long password"

Once configured, enable "Authentication" under "Configure Proxy" on iOS and enter the username/password. Android's built-in proxy settings don't support credentials, so you'll need a proxy-aware client that supports authentication, or just enable sharing temporarily whenever you actually need it.

One last habit worth keeping: once you're done sharing, go back to Settings and turn off "LAN Sharing." The toggle just returns to listening on localhost only — it won't affect your PC's own proxy usage.

Download Clash Verge Rev

Free and open-source, supports Windows / macOS / Linux, with mihomo built in. After installing, import your subscription following the setup guide, then come back here to enable LAN sharing.

Download Clash