mirror of https://github.com/Dreamacro/clash.git
Doc: fix script example error (#2876)
This commit is contained in:
parent
ac3fd60d54
commit
e5668687ab
|
@ -18,9 +18,10 @@ mode: Script
|
||||||
script:
|
script:
|
||||||
code: |
|
code: |
|
||||||
def main(ctx, metadata):
|
def main(ctx, metadata):
|
||||||
ip = metadata["dst_ip"] = ctx.resolve_ip(metadata["host"])
|
ip = ctx.resolve_ip(metadata["host"])
|
||||||
if ip == "":
|
if ip == "":
|
||||||
return "DIRECT"
|
return "DIRECT"
|
||||||
|
metadata["dst_ip"] = ip
|
||||||
|
|
||||||
code = ctx.geoip(ip)
|
code = ctx.geoip(ip)
|
||||||
if code == "LAN" or code == "CN":
|
if code == "LAN" or code == "CN":
|
||||||
|
|
Loading…
Reference in New Issue