Closed MNDIA closed 1 month ago
Using PASS in sub-rules
Thank you very much for your help. I'll leave a PASS example for those who follow up looking for related issues. The only current mihomo that enables runtime switching is proxy-groups
TroxyInPort: &TroxyInPort 65535
ReqableOutPort: &ReqableOutPort 9000
ReqableInPort: &ReqableInPort 65529
listeners:
- name: tproxy-in # This entry point enters all the traffic from the device kernel (no loopback)
type: tproxy
port: *TroxyInPort
listen: 127.0.0.1
udp: true
rule: rules #default
- name: http-in # Accepting post-capture proxies from reqable
type: http
port: *ReqableInPort
listen: 127.0.0.1
rule: rules #default
proxies:
- name: Reqable # Send traffic to reqable via socks
type: socks5
server: 127.0.0.1
port: *ReqableOutPort
udp: true
proxy-groups: # proxy-groups, the only kind of thing that can be switched without affecting other proxies at runtime
- {name: InboundBridge , type: select, proxies: [PASS,Reqable]}
rules:
- IP-CIDR,100.64.0.0/10,Tailscale,no-resolve
- DOMAIN-SUFFIX,.ts.net,Tailscale
- GEOIP,lan,DIRECT,no-resolve
- RULE-SET,loopback_classical,LoopOutlet # An insurance policy against loopbacks, that should never go into effect
- IN-NAME,tproxy-in,InboundBridge # If required, Send remaining traffic to reqable via socks
- ......Many complex diversions
Verify steps
Description
"什么功能?" Allow the rules field to accept an optional list for switching rules at runtime, e.g. [rules, sub-rule], rather than just a fixed value rules / my-sub-rule. Like proxy-groups switches the proxy inside, runtime switches a validated rule in the rule list of the listener
"目前 Mihomo Core 的行为是什麽?"
"这个问题如何影响到你?" Originally the traffic Path was routed to
On top of that, we need to capture the web packets. (Or insert other treatments into mihomo) The Path :
The process of switching between the two paths, requires runtime changes: [tproxy port-mihomo-rules]->[tproxy port-mihomo-rule-reqable]
Global/rules mode can do runtime switching, very similar but different. The functionality is that an inbound traffic needs to be diverted from complex rules to a node (like global mode), but the problem is that all the inbound stations of mihomo are in a shared (rules/global) mode, and it is not possible to keep a tproxy all to one node (like switching the global), and at the same time keep a stocks still using complex rules.
Possible Solution
Like proxy-groups switches the proxy inside. In runtime switches to a validated rule in the rule list of the listener
List
reqable