gasperk/injoxy
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
Run:
node injoxy.js
Uses the default config.json configuration file
node injoxy.js mycfg.json
Uses mycfg.json as the config
Config files are monitored for changes and proxy restarts when this happens automatically.
Config:
Config file must be in valid JSON format.
settings:
proxy_port: port on which the proxy listens
bust_cache: rewrite cache headers in the response, instructing the browser not to cache anything
patterns:
an array of spec:
url: url to match
url_match: 'equals' means url must match exacly, 'includes' just looks for a substring
content_types: an array of content types to match
search: regex string that defines the pattern you're looking for in the response
inject: the string to inject in the document
inject_method: 'before', 'after', and 'replace' the search pattern
Technical details:
The proxy forces connection closing on both sides by adding "Connection: close" header to
the request and response. This is to avoid node's file limit hit.