filter proxy


Author: yifei / Created: May 30, 2017, 4:15 p.m. / Modified: May 30, 2017, 4:16 p.m. / Edit

filter_rules.yml

filter values and store them to redis

filters.yml

filters:
  - stage: response
    match:
      url: [contains, /rest/n/user/list]
      client: [ip, 10.0.0.0]
    capture: 
      - location: text  # capture can be text/header/cookie/url/
        processors:
          - [json_at, '.']

filters:
  - stage: request
    url: [contains, /profile_ext]
    capture:
      - location: url
        processors:
          - [get_url_param, ]
      - location: header
        processors:
          - [header_name, x-wechat-uin]
    set_response:
      - status_code: 200
      - text:

filters:
  - stage: request
    url: [contains, /getverifyinfo]
    capture:
      - location: url
        processors:
          - [get_url_param]
    set_response:
      - status_code: 200
      - text_file: ... 

评论区