mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-07-30 22:11:26 +08:00
12 lines
354 B
YAML
12 lines
354 B
YAML
script:
|
|
code: |
|
|
def main(ctx, metadata):
|
|
ip = metadata["dst_ip"] = ctx.resolve_ip(metadata["host"])
|
|
if ip == "":
|
|
return "DIRECT"
|
|
|
|
code = ctx.geoip(ip)
|
|
if code == "LAN" or code == "CN":
|
|
return "DIRECT"
|
|
|
|
return "Proxy" # default policy for requests which are not matched by any other script |