Advanced 8 min read
Clash Mixed Port and LAN Sharing: Configure mixed-port and allow-lan
Learn how mixed-port handles HTTP and SOCKS5, share your proxy with phones and TVs using allow-lan, and configure bind-address and firewall rules.
What do mixed-port and LAN sharing each do?
To use Clash on your computer from your phone, first identify three things: your computer’s LAN IP address, the mixed port actually used by the core, and the proxy protocol supported by your phone’s app. For example, if your computer’s address is 192.168.1.20 and the mixed port is 7890, enable LAN connections on the computer and allow the corresponding inbound firewall rule. Then set your phone’s manual HTTP proxy to 192.168.1.20 and port 7890. The port 7890 is just an example; your client may use a different port.
mixed-portprovides a single proxy endpoint. The same TCP listening port accepts HTTP proxy requests and SOCKS5 connections, with the core detecting the protocol sent by the client. Apps that support SOCKS5 can use SOCKS5, while your phone’s manual system proxy can use HTTP. Both can use the same address and port.allow-lancontrols whether other devices can connect to the proxy endpoint. Enabling it does not configure the proxy on your phone or route all of your phone’s traffic through the computer.bind-addressspecifies which local address the core listens on. Using your computer’s LAN address can restrict the listening interface, but it does not control which phones can connect. Use a firewall or other access controls to restrict client IPs.
An HTTP proxy can also access HTTPS websites: browsers typically use an HTTP CONNECT request to establish a tunnel, while certificate validation between the browser and website proceeds as usual. This setup is for apps that connect to a proxy directly; you don’t need to enable TUN to share the proxy. TUN routes traffic from the local device through a virtual network interface. Enabling TUN on your computer will not automatically route traffic from your TV or phone.
Set up the computer: check the address, listening port, and active configuration
- Find your computer’s LAN IPv4 address. On Windows, open a terminal and run
ipconfig. Find the “IPv4 Address” for the wireless or Ethernet adapter connected to your home router. On macOS, go to “System Settings” → “Network” → your current connection → “Details” → “TCP/IP.” Don’t use the router’s default gateway, a proxy node address, or127.0.0.1. The last one is a loopback address and points to the phone itself when entered on your phone. - Check which proxy settings the client is actually using. Look for “Mixed Port” and “Allow LAN” in the client settings; the labels may vary by version. With a GUI client, make changes in its settings or configuration override options. An override is a set of local settings applied to the final running configuration. Editing the original downloaded subscription file directly may not work: a subscription update can overwrite your changes, and the client may replace the port setting with its own.
- Enable sharing and reload the configuration. If you manage mihomo’s local YAML directly, merge these fields into the top level of the configuration. Don’t declare the same key more than once. Replace the example address with your computer’s actual address, save and reload, then check the core logs for address binding failures or port conflicts.
mixed-port: 7890
allow-lan: true
bind-address: "192.168.1.20"
Your computer’s IP address may change when it reconnects to Wi-Fi. For a stable address, set up a DHCP reservation for the computer on your own router. This tells the router to assign the same LAN address to that device. If the address changes, update the server address on your phone and TV, and check the bind address and firewall rules as well.
What proxy settings should you use on phones and TVs?
| Device or app | Where to configure it / protocol | Value to enter |
|---|---|---|
| iPhone / iPad | “Settings” → “Wi-Fi” → info button next to the current network → “Configure Proxy” → “Manual” | Server 192.168.1.20, port 7890 |
| Android phone | Open the current Wi-Fi network’s edit screen, expand Advanced options, and set “Proxy” to “Manual.” Menu names and locations vary by manufacturer. | Proxy hostname 192.168.1.20, proxy port 7890 |
| TV or set-top box | If network settings include “Manual proxy,” check whether HTTP proxy is supported. If there’s no such option, see whether the app has its own proxy settings. | Choose a protocol supported by the app, then enter the computer’s address and mixed port |
| Apps that support SOCKS5 | Select SOCKS5 explicitly in the app’s proxy settings | Host 192.168.1.20, port 7890 |
If the host and port have separate fields, enter only the IP address in the host field—no http://, path, or port. After saving, open a website you know is reachable in a browser, then check the client’s connection log on the computer. If the request appears but the outbound route is “DIRECT,” that doesn’t mean the phone bypassed the proxy. The request may have reached the computer, while Clash’s rules routed the destination directly.
The system Wi-Fi proxy applies only to apps that honor that setting, and usually only on the current Wi-Fi network. If a TV browser works but a video app doesn’t, the app may use its own network stack, ignore the system proxy, or rely on UDP traffic that a manual HTTP proxy cannot forward. Check whether the app supports proxies; changing the mixed port won’t fix a protocol mismatch.
Configure the firewall: allow only the proxy port and only the devices that need access
Even when the core allows LAN connections, the host firewall may still block requests from your phone. For an HTTP proxy in a Windows browser, open “Windows Defender Firewall with Advanced Security” and go to “Inbound Rules” → “New Rule” → “Port.” Select TCP and enter 7890 as the specific local port. Apply the rule only to the “Private” profile used by your trusted home network. After creating the rule, open its Properties, select “Scope,” and enter the test phone’s IP address under Remote IP address—for example, 192.168.1.35. If only one or two devices need access, restrict the rule to those devices instead of allowing the entire subnet.
Connect the phone and computer to the same trusted home network first. Guest Wi-Fi or wireless networks with client isolation may block devices from communicating with one another, even when they have internet access. In that case, move the test device to your own network with device-to-device access enabled instead of disabling guest isolation or exposing the proxy to the internet.
Can’t connect? Use the connection logs to narrow it down
- First, check that the port is listening. In a Windows terminal, run
netstat -ano | findstr :7890and check the Local Address column andLISTENINGstatus. If the only address shown is127.0.0.1:7890, other devices can’t reach the port through your computer’s LAN address. If there’s no listener, check that the core is running, the configuration is active, and the port isn’t in use by another process. - Next, check whether the request reaches the computer. If a webpage times out on your phone and there’s no matching connection in the core logs, verify the IP address and port on the phone. Then check the firewall’s network profile and remote address range, and make sure the router isn’t isolating devices. Change one setting at a time so you can tell what affected the result.
- Finally, check the outbound route. If the phone’s request appears in the logs but the webpage won’t load, check the matching routing rule, the current proxy group selection, and whether the same core on the computer can reach the same destination. If you see an authentication error, check whether the proxy endpoint requires authentication and whether the device can send the right credentials. Don’t weaken access controls across the network just to support one device.
If you only need sharing for a quick test, turn off the Wi-Fi proxy on your phone or TV first. Then disable “Allow LAN” on the computer, reload the configuration, and remove the temporary inbound firewall rule. Otherwise, if the computer sleeps, leaves the network, or gets a new address, apps on your devices may keep trying to use the old proxy address, leaving Wi-Fi connected but websites unreachable.