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