Add GeoIP and GeoSite support for expr (#38)
* feat: copy something from hysteria/extras/outbounds/acl * feat: add geoip and geosite support for expr * refactor: geo matcher * fix: typo * refactor: geo matcher * feat: expose config options to specify local geoip/geosite db files * refactor: engine.Config should not contains geo * feat: make geosite and geoip lazy downloaded * chore: minor code improvement * docs: add geoip/geosite usage --------- Co-authored-by: Toby <tobyxdd@gmail.com>
This commit is contained in:
@@ -107,6 +107,14 @@ to [Expr Language Definition](https://expr-lang.org/docs/language-definition).
|
||||
- name: block google socks
|
||||
action: block
|
||||
expr: string(socks?.req?.addr) endsWith "google.com" && socks?.req?.port == 80
|
||||
|
||||
- name: block bilibili geosite
|
||||
action: block
|
||||
expr: geosite(string(tls?.req?.sni), "bilibili")
|
||||
|
||||
- name: block CN geoip
|
||||
action: block
|
||||
expr: geoip(string(ip.dst), "cn")
|
||||
```
|
||||
|
||||
#### Supported actions
|
||||
|
||||
Reference in New Issue
Block a user