Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

whistle 的规则过滤功能 #14

Open
avwo opened this issue Aug 17, 2020 · 0 comments
Open

whistle 的规则过滤功能 #14

avwo opened this issue Aug 17, 2020 · 0 comments

Comments

@avwo
Copy link
Owner

avwo commented Aug 17, 2020

whistle 支持通过 域名路径正则通配符方式匹配请求URL外,也支持通过 filter 实现通过 请求方法请求头请求内容响应状态码响应头 等方式实现更复杂的匹配,如:

* reqHeaders://`x-test=${reqCookies.test}` includeFilter://reqH:cookies=/test=\d+;/

上述表示匹配请求头cookie里面包含 test=数字 的请求,且将cookie里面的 test 字段值设置到请求头里面。

除了上面的 excludeFilterincludeFilter 是通过 url请求方法请求头请求内容响应状态码响应头 等过滤当前匹配的规则,whistle 也支持通过 ignore 忽略指定规则协议,如:

# 忽略 ke.qq.com 的所有 whistle 规则
ke.qq.com ignore://*

# 忽略 fudao.qq.com 的 host 规则
fudao.qq.com ignore://host

# 只保留 abcmouse.qq.com/path/to 的修改请求头规则
abcmouse.qq.com ignore://*
abcmouse.qq.com/path/to reqHeaders://x-test=abc ignore://-reqHeaders

更多内容参考:

  1. pattern: https://wproxy.org/whistle/pattern.html
  2. filter: https://wproxy.org/whistle/rules/filter.html
  3. ignore: https://wproxy.org/whistle/rules/ignore.html
  4. 如需跟灵活的匹配可以用插件:https://wproxy.org/whistle/plugins.html
@avwo avwo changed the title whistle 高级匹配功能 whistle 的规则过滤功能 Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant