0.0.4 • Published 8 years ago
swproxy-mod-rewrite v0.0.4
swproxy
work in progress
How to use the RewriteMod
// register the mod
proxy.registerMod(ModRewrite);
// define a new rewrite rule
proxy.rewriteRule(new RegExp('.*/some/path', ''), '/some/other/path', {});
// change the domain for every request that ends with /some/path
proxy.rewriteRule(new RegExp('.*/(some/path)', ''), 'https://example.com/$1', {});
proxy.rewriteRule(srcUrl, destUrl, modifiers);
srcUrl:
- the rule will only executed for requests, that matches this regular expression.
destUrl:
- the request Url will be modified, so the that the destUrl will be used, to make the final request.
modifiers:
- modifiers are an JavaScript Object "{}"
- They can be swproxy specific like 'stopPropagation'. See (doc)https://github.com/alexanderbartels/swproxy#modifier for more information.
- ...
License
MIT © Alexander Bartels
0.0.4
8 years ago
0.0.3
8 years ago
0.0.2
8 years ago
0.0.1
8 years ago
0.0.0-beta.2
8 years ago
0.0.0-beta.1
8 years ago