xcode75 / XManagerPlus

An Xray Manager
https://xcode75.github.io/XMPlusDocs/
267 stars 48 forks source link

direct geo site #63

Closed matador7495 closed 1 year ago

matador7495 commented 1 year ago

We found the correct code, Iranian sites are blocked with this code. But we need guidance for one thing. Because our problem is not solved. We want that when the user enters the Iranian site with VPN, he enters with the Iranian IP (real IP), not the IP of the server.

Please guide how we should do this.

route.json

{
    "domainStrategy": "IPIfNonMatch",
    "rules": [
      {
        "ip": [
          "geoip:private",
          "geoip:ir"
        ],
        "outboundTag": "blocked",
        "type": "field"
      },
      {
        "outboundTag": "blocked",
        "protocol": [
          "bittorrent"
        ],
        "type": "field"
      },
      {
        "outboundTag": "blocked",
          "domain": [
            "regexp:.*\\.ir$",
            "ext:iran.dat:ir",
            "ext:iran.dat:other",
            "geosite:category-ir-gov",
            "geosite:category-ir-news",
            "geosite:category-ir-bank",
            "geosite:category-ir-tech",
            "geosite:category-ir-travel",
            "geosite:category-ir-shopping",
            "geosite:category-ir-insurance",
            "geosite:category-ir-scholar",
            "snapp", "digikala","tapsi", "blogfa", "bank", "sb24.com", "sheypoor.com", "tebyan.net", "beytoote.com", "telewebion.com", "Film2movie.ws", "Setare.com", "Filimo.com", "Torob.com", "Tgju.org", "Sarzamindownload.com", "downloadha.com", "P30download.com", "Sanjesh.org"
          ],
        "type": "field"
      }
    ]
}

outbound.json

[
    {
      "protocol": "freedom",
      "settings": {}
    },
    {
      "protocol": "blackhole",
      "settings": {},
      "tag": "blocked"
    }
  ]
matador7495 commented 1 year ago

Please advise on this issue then close

mehtiamgh commented 1 year ago

hi you can use this but not working on xmplus

outbound.json

{
    "domainStrategy": "IPIfNonMatch",
    "rules": [
      {
        "ip": [
          "geoip:private",
          "geoip:ir"
        ],
        "outboundTag": "direct",
        "type": "field"
      },
      {
        "outboundTag": "direct",
        "protocol": [
          "bittorrent"
        ],
        "type": "field"
      },
      {
        "outboundTag": "direct",
          "domain": [
            "regexp:.*\\.ir$",
            "ext:iran.dat:ir",
            "ext:iran.dat:other",
            "geosite:category-ir-gov",
            "geosite:category-ir-news",
            "geosite:category-ir-bank",
            "geosite:category-ir-tech",
            "geosite:category-ir-travel",
            "geosite:category-ir-shopping",
            "geosite:category-ir-insurance",
            "geosite:category-ir-scholar"
          ],
        "type": "field"
      }
    ]
}

route.json

[
    {
      "protocol": "freedom",
      "settings": {},
      "tag": "direct"
    }
  ]
xcode75 commented 1 year ago

You have change the content of the json files and lso you need the .dat file that contains the rule. https://github.com/xcode75/XManagerPlus/issues/34

amihos commented 1 year ago

@matador7495 Just change the outbandtags to "direct" instead of "blocked".

mehtiamgh commented 1 year ago

You have change the content of the json files and lso you need the .dat file that contains the rule.

34

I want to do this : If geoip:ir connection : direct Else connection : proxy

i don’t want block connection i want direct connection when ip or domain for IR

Only use the VPN service if the IP or domain is not equal to IR

xcode75 commented 1 year ago

You have change the content of the json files and lso you need the .dat file that contains the rule.

34

I want to do this : If geoip:ir connection : direct Else connection : proxy

i don’t want block connection i want direct connection when ip or domain for IR

Only use the VPN service if the IP or domain is not equal to IR

xray-core cannot do that, there is no protocol for that. You can create an issue in official xray-core repo and ask.

Hooti66 commented 1 year ago

I have messaged you for 2 days to update the domain because it was filtered You are not responsive at all All my users are angry No one can connect Once you say you are not at home Once you tell me to prove that it is filtered You introduce working hours, but you are not responsive during those hours You advertise wrongly and then you don't support it

amihos commented 1 year ago

@xcode75 I suddenly started to get this error message on (only two) of my backend servers from one hour ago:

May 22 13:50:33 xm-backend-ch3 XMPlus[13630]: XMPlus v2.1.3 (A custom version of XrayR) May 22 13:50:33 xm-backend-ch3 XMPlus[13630]: 2023/05/22 13:50:33 Starting XMPlus May 22 13:50:33 xm-backend-ch3 XMPlus[13630]: 2023/05/22 13:50:33 Failed to understand Routing config Please check: https://xtls.github.io/config/routing.html for help: infra/conf: invalid field rule > infra/conf: failed to parse domain rule: geosite:category-ir-gov > infra/conf: failed to load geosite: CATEGORY-IR-GOV > infra/conf: list not found in geosite.dat: CATEGORY-IR-GOV May 22 13:50:33 xm-backend-ch3 XMPlus[13630]: panic: Failed to understand Routing config Please check: https://xtls.github.io/config/routing.html for help: infra/conf: invalid field rule > infra/conf: failed to parse domain rule: geosite:category-ir-gov > infra/conf: failed to load geosite: CATEGORY-IR-GOV > infra/conf: list not found in geosite.dat: CATEGORY-IR-GOV May 22 13:50:33 xm-backend-ch3 XMPlus[13630]: goroutine 1 [running]: May 22 13:50:33 xm-backend-ch3 XMPlus[13630]: log.Panicf({0x31ca2fc?, 0x48a?}, {0xc000141be8?, 0x29ac160?, 0xc0004f6f50?}) May 22 13:50:33 xm-backend-ch3 XMPlus[13630]: log/log.go:391 +0x67 May 22 13:50:33 xm-backend-ch3 XMPlus[13630]: github.com/xcode75/XMPlus/panel.(Panel).loadCore(0xc0005f3e68?, 0xc0001661c0) May 22 13:50:33 xm-backend-ch3 XMPlus[13630]: github.com/xcode75/XMPlus/panel/panel.go:83 +0x3ff May 22 13:50:33 xm-backend-ch3 XMPlus[13630]: github.com/xcode75/XMPlus/panel.(Panel).Start(0xc0004c9740) May 22 13:50:33 xm-backend-ch3 XMPlus[13630]: github.com/xcode75/XMPlus/panel/panel.go:158 +0xe9 May 22 13:50:33 xm-backend-ch3 XMPlus[13630]: main.main() May 22 13:50:33 xm-backend-ch3 XMPlus[13630]: github.com/xcode75/XMPlus/main/main.go:93 +0x2bf May 22 13:50:33 xm-backend-ch3 systemd[1]: XMPlus.service: Main process exited, code=exited, status=2/INVALIDARGUMENT May 22 13:50:33 xm-backend-ch3 systemd[1]: XMPlus.service: Failed with result 'exit-code'. May 22 13:50:43 xm-backend-ch3 systemd[1]: XMPlus.service: Scheduled restart job, restart counter is at 23. May 22 13:50:43 xm-backend-ch3 systemd[1]: Stopped XMPlus Service. May 22 13:50:43 xm-backend-ch3 systemd[1]: Started XMPlus Service.

when I comment out routing in config.yml it keeps working fine. I did not change any thing whatsoever on any of my backend servers and frontend. The rest of the servers are working just fine.

Here is the routing.json file I am using:

{ "domainStrategy": "IPIfNonMatch", "rules": [ { "ip": [ "geoip:private", "geoip:ir" ], "outboundTag": "blocked", "type": "field" }, { "outboundTag": "blocked", "protocol": [ "bittorrent" ], "type": "field" }, { "outboundTag": "blocked", "domain": [ "regexp:.*\.ir$", "ext:iran.dat:ir", "ext:iran.dat:other", "geosite:category-ir-gov", "geosite:category-ir-news", "geosite:category-ir-bank", "geosite:category-ir-tech", "geosite:category-ir-travel", "geosite:category-ir-shopping", "geosite:category-ir-insurance", "geosite:category-ir-scholar", "snapp", "digikala","tapsi", "blogfa", "bank", "sb24.com", "sheypoor.com", "tebyan.net", "beytoote.com", "telewebion.com", "Film2movie.ws", "Setare.com", "Filimo.com", "Torob.com", "Tgju.org", "Sarzamindownload.com", "downloadha.com", "P30download.com", "Sanjesh.org" ], "type": "field" } ] }

I even deleted and reinstalled the backend from scratch but this happened again.