GeoIP: Update inverse geoip syntax examples

https://github.com/XTLS/Xray-core/pull/5951#issuecomment-4273468491
This commit is contained in:
Meow
2026-04-18 19:08:21 +08:00
parent ebb6485557
commit 291770a5f0
6 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -108,7 +108,7 @@
- 预定义 IP 列表:此列表预置于每一个 Xray 的安装包中,文件名为 `geoip.dat`。使用方式形如 `"geoip:cn"`,必须以 `geoip:`(小写)开头,后面跟双字符国家代码,支持几乎所有可以上网的国家。
- 特殊值:`"geoip:private"`,包含所有私有地址,如 `127.0.0.1`
- 从文件中加载 IP:形如 `"ext:file:tag"`,必须以 `ext:`(小写)开头,后面跟文件名和标签,文件存放在 [资源目录](./features/env.md#资源文件路径) 中,文件格式与 `geoip.dat` 相同标签必须在文件中存在。
- 反选 `!` 功能:`"!10.0.0.0/8"` 表示非 `10.0.0.0/8``"!geoip:cn"` 表示非 `geoip:cn` 中的结果。多个反选项之间是 `AND` 关系,而正选项、正选项和所有的反选项之间是 `OR` 关系,例如 `ip: ["geoip:!cn", "!geoip:us", "geoip:telegram"]` 匹配非美国并且非中国的 IP,或者是 telegram 的 IP。
- 反选 `!` 功能:`"!10.0.0.0/8"` 表示非 `10.0.0.0/8``"!geoip:cn"` 表示非 `geoip:cn` 中的结果。多个反选项之间是 `AND` 关系,而正选项、正选项和所有的反选项之间是 `OR` 关系,例如 `ip: ["!geoip:cn", "!geoip:us", "geoip:telegram"]` 匹配非美国并且非中国的 IP,或者是 telegram 的 IP。
> `port`number | string
+2 -2
View File
@@ -99,13 +99,13 @@ socks、http 入站时,请求的就是域名,到了路由后,路由中非
"address": "1.1.1.1",
"skipFallback": true,
"domains": ["geosite:geolocation-!cn"],
"expectIPs": ["geoip:!cn"]
"expectIPs": ["!geoip:cn"]
},
{
"address": "8.8.8.8",
"skipFallback": true,
"domains": ["geosite:geolocation-!cn"],
"expectIPs": ["geoip:!cn"]
"expectIPs": ["!geoip:cn"]
},
{
"address": "8.8.8.8",
+1 -1
View File
@@ -108,7 +108,7 @@ An array, where each item represents an IP range. The rule takes effect when an
- **Predefined IP list**: This list is pre-installed in every Xray installation package, named `geoip.dat`. Usage is like `"geoip:cn"`. Must start with `geoip:` (lowercase), followed by a two-character country code. Supports almost all countries with internet access.
- **Special value**: `"geoip:private"`, includes all private addresses, such as `127.0.0.1`.
- **Load IPs from file**: In the form of `"ext:file:tag"`. Must start with `ext:` (lowercase), followed by filename and tag. The file is stored in the [Resource Directory](./features/env.md#resource-file-path). The file format is the same as `geoip.dat`, and the tag must exist in the file.
- **Inverse selection `!`**: `"!10.0.0.0/8"` means anything not in `10.0.0.0/8`, and `"!geoip:cn"` means results not in `geoip:cn`. Multiple inverse options have an `AND` relationship, while positive options, or positive options together with all inverse options, have an `OR` relationship. For example, `ip: ["geoip:!cn", "!geoip:us", "geoip:telegram"]` matches IPs that are not from the US AND not from China, OR are Telegram IPs.
- **Inverse selection `!`**: `"!10.0.0.0/8"` means anything not in `10.0.0.0/8`, and `"!geoip:cn"` means results not in `geoip:cn`. Multiple inverse options have an `AND` relationship, while positive options, or positive options together with all inverse options, have an `OR` relationship. For example, `ip: ["!geoip:cn", "!geoip:us", "geoip:telegram"]` matches IPs that are not from the US AND not from China, OR are Telegram IPs.
> `port`: number | string
+2 -2
View File
@@ -101,13 +101,13 @@ Having trouble? You need to re-read the official guide and try to understand it.
"address": "1.1.1.1",
"skipFallback": true,
"domains": ["geosite:geolocation-!cn"],
"expectIPs": ["geoip:!cn"]
"expectIPs": ["!geoip:cn"]
},
{
"address": "8.8.8.8",
"skipFallback": true,
"domains": ["geosite:geolocation-!cn"],
"expectIPs": ["geoip:!cn"]
"expectIPs": ["!geoip:cn"]
},
{
"address": "8.8.8.8",
+1 -1
View File
@@ -104,7 +104,7 @@
- Предопределенный список IP-адресов: этот список встроен в каждый установочный пакет Xray, имя файла - `geoip.dat`. Формат использования: `"geoip:код_страны"`, должно начинаться с `geoip:` (в нижнем регистре), за которым следует двухбуквенный код страны, поддерживаются почти все страны с доступом в Интернет.
- Специальное значение: `"geoip:private"`, включает в себя все частные адреса, например, `127.0.0.1`.
- Загрузка IP-адресов из файла: имеет вид `"ext:файл:тег"`, должно начинаться с `ext:` (в нижнем регистре), за которым следует имя файла и тег, файл хранится в [каталоге ресурсов](./features/env.md#путь-к-файлу-ресурсов), формат файла такой же, как у `geoip.dat`, тег должен существовать в файле.
- Функция инверсии `!`: `"!10.0.0.0/8"` обозначает всё, что не входит в `10.0.0.0/8`, а `"!geoip:cn"` — результаты, не входящие в `geoip:cn`. Несколько условий с отрицанием объединяются логическим **AND**, а положительные условия и совокупность всех отрицательных условий — логическим **OR**. Например, `ip: ["geoip:!cn", "!geoip:us", "geoip:telegram"]` соответствует IP, которые не относятся к США **И** не относятся к Китаю, **ИЛИ** являются IP Telegram.
- Функция инверсии `!`: `"!10.0.0.0/8"` обозначает всё, что не входит в `10.0.0.0/8`, а `"!geoip:cn"` — результаты, не входящие в `geoip:cn`. Несколько условий с отрицанием объединяются логическим **AND**, а положительные условия и совокупность всех отрицательных условий — логическим **OR**. Например, `ip: ["!geoip:cn", "!geoip:us", "geoip:telegram"]` соответствует IP, которые не относятся к США **И** не относятся к Китаю, **ИЛИ** являются IP Telegram.
> `port`: number | string
+2 -2
View File
@@ -102,13 +102,13 @@
"address": "1.1.1.1",
"skipFallback": true,
"domains": ["geosite:geolocation-!cn"],
"expectIPs": ["geoip:!cn"]
"expectIPs": ["!geoip:cn"]
},
{
"address": "8.8.8.8",
"skipFallback": true,
"domains": ["geosite:geolocation-!cn"],
"expectIPs": ["geoip:!cn"]
"expectIPs": ["!geoip:cn"]
},
{
"address": "8.8.8.8",