github.com/igoogolx/clash@v1.19.8/docs/configuration/inbound.md (about) 1 --- 2 sidebarTitle: Inbound 3 sidebarOrder: 3 4 --- 5 6 # Inbound 7 8 Clash supports multiple inbound protocols, including: 9 10 - SOCKS5 11 - HTTP(S) 12 - Redirect TCP 13 - TProxy TCP 14 - TProxy UDP 15 - Linux TUN device (Premium only) 16 17 Connections to any inbound protocol listed above will be handled by the same internal rule-matching engine. That is to say, Clash does not (currently) support different rule sets for different inbounds. 18 19 ## Configuration 20 21 ```yaml 22 # Port of HTTP(S) proxy server on the local end 23 # port: 7890 24 25 # Port of SOCKS5 proxy server on the local end 26 # socks-port: 7891 27 28 # HTTP(S) and SOCKS4(A)/SOCKS5 server on the same port 29 mixed-port: 7890 30 31 # Transparent proxy server port for Linux and macOS (Redirect TCP and TProxy UDP) 32 # redir-port: 7892 33 34 # Transparent proxy server port for Linux (TProxy TCP and TProxy UDP) 35 # tproxy-port: 7893 36 37 # Allow clients other than 127.0.0.1 to connect to the inbounds 38 allow-lan: false 39 ``` 40 41 ## The Mixed Port 42 43 The mixed port is a special port that supports both HTTP(S) and SOCKS5 protocols. You can have any programs that support either HTTP or SOCKS proxy to connect to this port, for example: 44 45 ```shell 46 $ curl -x socks5h://127.0.0.1:7890 -v http://connect.rom.miui.com/generate_204 47 * Trying 127.0.0.1:7890... 48 * SOCKS5 connect to connect.rom.miui.com:80 (remotely resolved) 49 * SOCKS5 request granted. 50 * Connected to (nil) (127.0.0.1) port 7890 (#0) 51 > GET /generate_204 HTTP/1.1 52 > Host: connect.rom.miui.com 53 > User-Agent: curl/7.81.0 54 > Accept: */* 55 > 56 * Mark bundle as not supporting multiuse 57 < HTTP/1.1 204 No Content 58 < Date: Thu, 11 May 2023 06:18:22 GMT 59 < Connection: keep-alive 60 < Content-Type: text/plain 61 < 62 * Connection #0 to host (nil) left intact 63 ``` 64 65 ## Redirect and TProxy 66 67 Redirect and TProxy are two different ways of implementing transparent proxying. They are both supported by Clash. 68 69 However, you most likely don't need to mess with these two inbounds - we recommend using [Clash Premium](/premium/introduction) if you want to use transparent proxying, as it has built-in support of the automatic management of the route table, rules and nftables.