2dust / v2rayNG

A V2Ray client for Android, support Xray core and v2fly core
https://1.2345345.xyz
GNU General Public License v3.0
34.89k stars 5.37k forks source link

How to bypass proxy for some specified domains? #1764

Closed agn-7 closed 1 year ago

agn-7 commented 1 year ago

How can I not use the proxy for some kind of domains in v2rayNG app? Actually, I say there is a section in settings named router setting and I added the following pattern to bypass proxy for that into the direct section but it doesn't work:

*.ir

In fact, I want to bypass the proxy for all websites that have .ir postfix domain.

yuhan6665 commented 1 year ago

Try domain:ir

agn-7 commented 1 year ago

@yuhan6665

It worked. But the problem is, in this case, I should add thousands of domains containing .ir suffix. Is there a smart solution for example using regex pattern to catch them?

yuhan6665 commented 1 year ago

I think it should work for all domain end with .ir so no regex is needed. We does support for regex though. Please refer to documentation for details https://xtls.github.io/config/routing.html#routingobject

agn-7 commented 1 year ago

@yuhan6665 thank you for your instant response. At the end of the documentation you sent, I found a way to bypass the proxy for all domains ending with .ir. To do that, you just need to add .ir, into the Settings --> Custom rules (Routing) --> Direct URL it IP

goldensky67 commented 1 year ago

Thank you for this solution. it works for me. is there any solution for V2rayN for desktop?

agn-7 commented 1 year ago

@goldensky67 I have no idea about V2rayN but I proposed a regex method for Nekoray here. Maybe the process would be the same in V2rayN as well. Give it a try.

mahansalimi commented 1 year ago

Thank you for this solution. it works for me. is there any solution for V2rayN for desktop?

for windows v2rayng : got to setting-> Option setting-> system Proxy setting and write *.ir ,then all ir websites will not use proxy.

for android v2rayng :setting - > custom ruls -> Direct url or IP - add "domain:ir" and save

برای پراکسی نشدن سایت های ایران با دامنه IR در v2rayng به روش بالا عمل کنید.

rezamilani commented 1 year ago

can we add more websites to bypass after the *.ir? if so is there a specific way to do it?

agn-7 commented 1 year ago

@rezamilani

you can add a comma (,) after .ir and place the respective URL or URL pattern:

.ir, domain:ir, example.com,
mahansalimi commented 1 year ago

can we add more websites to bypass after the *.ir? if so is there a specific way to do it?

Its better to use : android v2rayng :setting - > custom ruls -> Direct url or IP - add "geoip:ir" and save Also update geoip database from v2rayng - Geo assets files and push update icon above page.

QMahyar commented 7 months ago

can we bypass a process`? or a application in windows?

SamPourrahim commented 6 months ago

can we bypass a process`? or a application in windows?

For Windows Follow this:

  1. 1

  2. in global section >> click add rules

2

  1. set outbound tag on Direct and put the domain name in the first column

3

  1. make sure this rule should be above the default rule as you see in the second img.
rezamt1991 commented 5 months ago

is it possible to proxy only 1 url address ? all others urls on direct and specific urls just through proxy!

artanhaker05 commented 5 months ago

is it possible to proxy only 1 url address ? all others urls on direct and specific urls just through proxy!

I have this issues with discord.gg domain

mezhgano commented 3 months ago

I will leave it here for those who new to rules syntax like me.

All you need to understand how to wrote specific domain rules is this part of documentation: https://xtls.github.io/en/config/routing.html#ruleobject

Scroll to "domain" section.

So, to bypass (or proxy) all domains that contains a word, for example, amazon, you just type word amazon and that's it! Not domain:amazon, because it will lead to different behavior (read the link above).

For example:

Adding bypass rule domain:amazon Restarting service and visit https://checkip.amazonaws.com Result: It shows VPN server IP (Not works as expected)

Modifying rule to just plain amazon Result: It shows my direct IP (Gotcha!)