UDFScript变量说明 变量名 变量说明 举例 arg参数名 url中的某个具体参数的值 比如请求为: http参数名 某个请求头xxx的值 比如请求为: H "test: hello" H "headacc: 222", 调用ctyun.var("httptest")返回“hello”。 调用ctyun.var("httpheadacc") 返回“222”。 如果xxx有破折号,通过var调用时,用下划线代替。 cookiexxx 请求cookie头中的name值 使用方式同上。 scheme 请求使用的Web协议,“http” 或 “https” ctyun.var("scheme") 返回http。 serverprotocol 服务器的HTTP版本,通常为 “HTTP/1.0” 或 “HTTP/1.1” ctyun.var("serverprotocol") 返回HTTP/1.1。 timeiso8601 服务器时间的ISO 8610格式 ctyun.var("timeiso8601") 返回 20220714T11:13:56+08:00。 timelocal 服务器时间 ctyun.var("timelocal") 返回14/Jul/2022:11:13:56 +0800。 timehttp 服务器时间的http表示法 ctyun.var("timehttp") 返回 Thu, 14 Jul 2022 03:13:56 GMT。 host 客户端请求的域名 ctyun.var("host") 返回ctyun.cn。 requesturi 用户原始请求url包括查询参数 比如客户端发送请求uri为: /%E4%BD%A0%E5%A5%BD?tt123 ctyun.var("requesturi") 返回/%E4%BD%A0%E5%A5%BD?tt123。 uri requesturi变量中不带查询参数部分,且进行了urldecode 比如客户端发送请求uri为: /%E4%BD%A0%E5%A5%BD?tt123 ctyun.var("uri") 返回 /你好。 querystring 查询参数, requesturi的参数部分 比如:请求uri为: /hello?tt123&t2%E4%BD%A0%E5%A5%BD ctyun.var("querystring") 返回 tt123&t2%E4%BD%A0%E5%A5%BD。 requestmethod HTTP请求方法,通常为"GET"或"POST"等 ctyun.var("requestmethod") 返回GET。 remoteaddr 返回客户端ip ctyun.var("remoteaddr") 返回172.21.51.44。 remoteport 客户端端口号 ctyun.var("remoteport") 返回38966。 serveraddr 服务端ip ctyun.var("serveraddr") 返回172.21.51.88。 serverport 服务端端口号 ctyun.var("serverport") 返回80。