UNPKG

rtmor

Version:

_Real-time Modification of Requests_ - [github.com/Adrosar/rtmor](https://github.com/Adrosar/rtmor) - [bitbucket.org/Adrosar/rtmor](https://bitbucket.org/Adrosar/rtmor)

69 lines (63 loc) 2.3 kB
# Configuration: rules: # Visit the https://regex101.com website and see the effect. # I recommend this website for writing and testing regular expressions. - name: "DEV" host_name: "regex101.com" reg_exp: "(?mi).*" # Regular expression, Golang style. See https://golang.org/pkg/regexp/ location: "" mode: 0 # See ./internal/core/config.go → RuleModePASS body: "" type: "" active: true # Set to `false` to disable the rule. show_matches: true # The `true` value shows the match in the logs (terminal) # Visit the https://jquery.com website and see the effect. - name: "jQuery" host_name: "code.jquery.com" reg_exp: '(?m)\/jquery.*\.js' location: "" mode: 200 # See ./internal/core/config.go → RuleModeOK body: 'alert("[RtMoR] The script content has been changed!")' type: "text/javascript" active: true show_matches: true # Visit the https://reactjs.org website and see the effect. - name: "React" host_name: "unpkg.com" reg_exp: '(?m)\/babel\.min\.js$' location: "assets/babel/6.26.0/babel.js" # The `/` separator works in Windows, Linux and MacOS. mode: 237 # See ./internal/core/config.go → RuleModeFile body: "" type: "text/javascript" active: true show_matches: true # Visit the https://en.wikipedia.org website and see the effect. - name: "Wiki" host_name: "en.wikipedia.org" reg_exp: '(?m)enwiki\.png$' location: "" mode: 404 # See ./internal/core/config.go → RuleModeNotFound body: "" type: "" active: true show_matches: true # Visit the https://www.google.com website and see the effect. - name: "Google" host_name: "www.google.com" reg_exp: '(?m)^https?\:\/\/www\.google\.com(\:443)?/?$' location: "https://duckduckgo.com" # If `mode` is `307` then `location` must contain the URL. mode: 307 # See ./internal/core/config.go → RuleModeRedirect body: "" type: "" active: true show_matches: true # Visit the https://www.youtube.com website and see the effect. - name: "YouTube" host_name: "www.youtube.com" reg_exp: '(?mi).+\.js$' location: "" mode: 700 # See ./internal/core/config.go → RuleModeNoCache body: "" type: "" active: true show_matches: true