In case I choose neko box. How do I set up such routing rule that I want to proxy only…
- User
In case I choose neko box. How do I set up such routing rule that I want to proxy only example.com site and all other traffic to be direct?
Assistant
To set up Nekoray (formerly known as Neko Box) to proxy only
example.comand route all other traffic directly, follow these steps:
Step-by-Step Guide
1. Ensure Nekoray is Configured with a Proxy
- Make sure you have a working proxy configuration (e.g., V2Ray, Xray, or Shadowsocks) added to Nekoray. This is the "Proxy" server that will handle
example.com.
2. Locate the Configuration File
- Open Nekoray.
- Go to Profiles > Edit (or click the gear icon).
- Find the
config.jsonfile for your profile. This is the core configuration file for V2Ray/Xray.
3. Modify the Routing Rules
In the
config.json, locate the"routing"section. Replace or update it with the following:"routing": { "domainStrategy": "IP", // Use IP-based routing for better compatibility "rules": [ { "type": "domain", "domain": "example.com", "outboundTag": "Proxy" // Send only example.com to the proxy }, { "type": "range", "ip": ["0.0.0.0/0"], "outboundTag": "Direct" // Default: all other traffic goes direct } ] }Explanation:
"type": "domain"matches the exact domainexample.com."outboundTag": "Proxy"routes this traffic through your proxy.- The second rule (
"type": "range") acts as a fallback for all other traffic, sending it directly.
4. Save and Reload the Configuration
- Save the
config.jsonfile. - In Nekoray, go to Profiles > Reload (or restart the app) to apply the changes.
5. Test the Setup
- Open a browser and visit
example.com. It should use the proxy. - Visit another site (e.g.,
google.com). It should bypass the proxy (direct connection).
Key Notes
- Domain Matching:
- Use
"type": "domain"for exact domain matches (e.g.,example.com). - Use
"type": "domain-suffix"for subdomains (e.g.,*.example.com).
- Use
- Default Rule: The last rule in the
rulesarray acts as the fallback. Ensure it routes to"Direct". - Troubleshooting: If traffic isn’t routing as expected, check the Nekoray logs (under Tools > Log) for errors.
Alternative: Use Nekoray’s GUI (if available)
If Nekoray has a visual rule editor (check the latest version), you can:
- Go to Routing > Add Rule.
- Set:
- Type:
Domain - Domain:
example.com - Outbound: Your proxy server (e.g.,
Proxy)
- Type:
- Add a default rule for all other traffic:
- Type:
Range - IP:
0.0.0.0/0 - Outbound:
Direct
- Type:
Why This Works
- Nekoray uses V2Ray/Xray under the hood, which supports domain-based routing.
- The
"domainStrategy": "IP"ensures compatibility with IP-based rules (e.g., blocking China’s IP ranges).
Let me know if you need help converting a subscription link or troubleshooting! 🚀
- Make sure you have a working proxy configuration (e.g., V2Ray, Xray, or Shadowsocks) added to Nekoray. This is the "Proxy" server that will handle
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.