whistle 帮助文档

260课时
760学过
8分

3. 命令行操作

4. 手动更新

9. 匹配原则

13. 注意事项

14. 常见问题

16. 协议列表

协议列表

@ 功能

设置UI样式

设置hosts

设代理

延迟请求

修改请求URL

修改请求方法

修改请求头

延迟响应

修改请求内容

修改响应状态码

修改响应头

修改响应内容

过滤配置

启用或禁用一些配置

获取抓包数据

动态设置规则

开发调试工具

@

host

保留传统的hosts语法规则

灵活强大的whistle匹配模式

host-例子

host-过滤规则

响应规则列表

请求替换

请求替换-过滤规则

file (xfile)

file (xfile)-过滤规则

xfile

xfile-过滤规则

tpl

tpl-过滤规则

xtpl

rawfile

rawfile-过滤规则

xrawfile

自定义

style

style-过滤规则

pipe

pipe-过滤规则

44 plugin

plugin-过滤规则

weinre

weinre-过滤规则

log

log-快速上手

不同页面 log 切换

嵌入自定义脚本

log-过滤规则

proxy(http-proxy)

proxy(http-proxy)-过滤规则

https-proxy

https-proxy-过滤规则

socks

socks-过滤规则

pac

pac-过滤规则

filter (excludeFilter includeFilter)

filter (excludeFilter includeFilter)-例子

ignore

ignore-配置规则

ignore-忽略规则

enable

enable-过滤规则

disable

disable-过滤规则

delete

delete-过滤规则

urlParams

urlParams-过滤规则

pathReplace

pathReplace-过滤规则

method

method-过滤规则

statusCode

statusCode-过滤规则

replaceStatus

replaceStatus-过滤规则

referer

referer-过滤规则

auth

auth-过滤规则

ua

ua-过滤规则

cache

cache-过滤规则

redirect

redirect-过滤规则

attachment

attachment-过滤规则

forwardedFor-过滤规则

responseFor

responseFor-过滤规则

reqMerge

reqMerge-例子

reqMerge-过滤规则

resMerge

resMerge-例子

resMerge-过滤规则

reqScript (reqRules)

reqScript (reqRules)-静态规则列表

reqScript (reqRules)-通过脚本动态设置规则

reqScript (reqRules)-过滤规则

resScript (resRules)

resScript (resRules)-静态规则列表

resScript (resRules)-通过脚本动态设置规则

resScript (resRules)-过滤规则

reqDelay

reqDelay-过滤规则

resDelay

resDelay-过滤规则

reqSpeed

reqSpeed-过滤规则

resSpeed

resSpeed-过滤规则

reqType

reqType-过滤规则

resType

resType-过滤规则

reqCharset

reqCharset-过滤规则

resCharset

resCharset-过滤规则

reqCookies

reqCookies-过滤规则

resCookies

resCookies-过滤规则

reqCors

reqCors-过滤规则

resCors

resCors-过滤规则

reqHeaders

reqHeaders-过滤规则

resHeaders

resHeaders-过滤规则

reqPrepend

reqPrepend-过滤规则

resPrepend

resPrepend-过滤规则

reqBody

reqBody-过滤规则

resBody

resBody-过滤规则

reqAppend

reqAppend-过滤规则

resAppend

resAppend-过滤规则

headerReplace

headerReplace-过滤规则

reqReplace

reqReplace-过滤规则

resReplace

resReplace-过滤规则

htmlPrepend

htmlPrepend-过滤规则

cssPrepend

cssPrepend-过滤规则

jsPrepend

jsPrepend-过滤规则

htmlBody

htmlBody-过滤规则

cssBody

cssBody-过滤规则

jsBody

jsBody-过滤规则

htmlAppend

htmlAppend-过滤规则

cssAppend

cssAppend-过滤规则

jsAppend

jsAppend-过滤规则

reqWrite

reqWrite-过滤规则

resWrite

resWrite-过滤规则

reqWriteRaw

reqWriteRaw-过滤规则

resWriteRaw

resWriteRaw-过滤规则

课程评价 (0)

请对课程作出评价:
0/300

学员评价

暂无精选评价
2分钟

filter (excludeFilter includeFilter)

以下功能需要把whistle(>= v2.4.3)升级到最新版本

excludeFilter和includeFilter是作为二级条件,用来过滤匹配已匹配的规则:

  1. excludeFilter:表示排除匹配的请求
  2. includeFilter:只保留匹配的请求
pattern operatorURI excludeFilter://p1 includeFilter://p2 includeFilter://p3

其中:p1、p2、... 可以为匹配模式里面的正则表达式、通配符、通配路径,具体参见:匹配模式,且支持匹配请求头、请求方法、请求IP等

pattern operatorURI excludeFilter://p0 excludeFilter://p1 includeFilter://p2 includeFilter://p3

上述表示:

匹配:!(p0 || p1) && (p2 || p3)

即:通过url匹配 pattern 的请求,要不能匹配p1、或匹配 p2、或不匹配 p3,后面过滤条件可以任意个。

如:

pattern operatorURI1  operatorURIx excludeFilter://*/cgi-bin includeFilter:///test/i excludeFilter://m:options includeFilter://m:get includeFilter://m:/^p/i excludeFilter://m:/^c/ excludeFilter://h:cookie=test excludeFilter://i:127.0.0.1

完整匹配条:

  1. m:name:name为方法名称或正则表达式,表示匹配对应方法
  2. i:ip:ip表示具体客户(服务)端ip或匹配ip的正则表达式
  3. clientIp:ip:ip表示具体客户端ip或匹配ip的正则表达式
  4. serverIp:ip:ip表示具体服务端ip或匹配ip的正则表达式
  5. s:code:code表示响应状态码,或正则表达式
  6. h:name=pattern:匹配请求或响应头字段 name,pattern为该字段对应值里面的关键字或正则表示
  7. reqH:name=pattern:同上,但只会匹配请求头
  8. resH:name=pattern:同上,但只会匹配响应头
  9. */cgi-*:表示匹配 xxx://x.y.z/cgi-.../...,具体可以参见pattern里面的通配路径
  10. 其它字符串:表示pattern里面的通配符匹配