support full domain matching
This commit is contained in:
parent
133f54e125
commit
10beea60bb
@ -12,6 +12,7 @@ include:another-file
|
|||||||
domain:google.com
|
domain:google.com
|
||||||
keyword:google
|
keyword:google
|
||||||
regex:www\.google\.com
|
regex:www\.google\.com
|
||||||
|
full:www.google.com
|
||||||
```
|
```
|
||||||
|
|
||||||
Syntax:
|
Syntax:
|
||||||
@ -21,6 +22,7 @@ Syntax:
|
|||||||
* Subdomain begins with `domain:`, followed by a valid domain name. The prefix `domain:` may be omitted.
|
* Subdomain begins with `domain:`, followed by a valid domain name. The prefix `domain:` may be omitted.
|
||||||
* Keyword begins with `keyword:`, followed by string.
|
* Keyword begins with `keyword:`, followed by string.
|
||||||
* Regular expression begins with `regex:`, followed by a valid regular expression (per Golang's standard).
|
* Regular expression begins with `regex:`, followed by a valid regular expression (per Golang's standard).
|
||||||
|
* Full domain begins with `full:`, followed by a domain.
|
||||||
|
|
||||||
## How it works
|
## How it works
|
||||||
|
|
||||||
@ -34,6 +36,7 @@ To generate a section:
|
|||||||
1. Generate each `domain:` line into a [sub-domain routing rule](https://github.com/v2ray/v2ray-core/blob/master/app/router/config.proto#L21).
|
1. Generate each `domain:` line into a [sub-domain routing rule](https://github.com/v2ray/v2ray-core/blob/master/app/router/config.proto#L21).
|
||||||
1. Generate each `keyword:` line into a [plain domain routing rule](https://github.com/v2ray/v2ray-core/blob/master/app/router/config.proto#L17).
|
1. Generate each `keyword:` line into a [plain domain routing rule](https://github.com/v2ray/v2ray-core/blob/master/app/router/config.proto#L17).
|
||||||
1. Generate each `regex:` line into a [regex domain routing rule](https://github.com/v2ray/v2ray-core/blob/master/app/router/config.proto#L19)
|
1. Generate each `regex:` line into a [regex domain routing rule](https://github.com/v2ray/v2ray-core/blob/master/app/router/config.proto#L19)
|
||||||
|
1. Generate each `full:` line into a [full domain routing rule](https://github.com/v2ray/v2ray-core/blob/master/app/router/config.proto#L23)
|
||||||
|
|
||||||
## File name guideline
|
## File name guideline
|
||||||
|
|
||||||
|
6815
data/ookla-speedtest
Normal file
6815
data/ookla-speedtest
Normal file
File diff suppressed because it is too large
Load Diff
5
main.go
5
main.go
@ -50,6 +50,11 @@ func (l *ParsedList) toProto() (*router.GeoSite, error) {
|
|||||||
Type: router.Domain_Plain,
|
Type: router.Domain_Plain,
|
||||||
Value: entry.Value,
|
Value: entry.Value,
|
||||||
})
|
})
|
||||||
|
case "full":
|
||||||
|
site.Domain = append(site.Domain, &router.Domain{
|
||||||
|
Type: router.Domain_Full,
|
||||||
|
Value: entry.Value,
|
||||||
|
})
|
||||||
default:
|
default:
|
||||||
return nil, errors.New("unknown domain type: " + entry.Type)
|
return nil, errors.New("unknown domain type: " + entry.Type)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user