Skip to content

nirror/web-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A web proxy for rewriting web responses on the fly. Based on node-unblocker.

Example

Inject a javascript tag at the end of the page.

var niScriptTag = [
    '<script type="text/javascript">',
    "(function(i,s,o,g,r,a,m){i['NirrorObject']=r;i[r]=i[r]||function(){",
    "(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();i[r].scriptURL=g;a=s.createElement(o),",
    "m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)",
    "})(window,document,'script','https://static.nirror.com/client/nirrorclient.js','Ni');",
    '</script>'
].join("\n");

require("web-proxy")({
	processChunk: function(html) {
		return html.replace("</body>", niScriptTag + "\n</body>");
	}
});

License

This project is released under the terms of the GNU GPL version 3

About

Web proxy for rewriting http responses on the fly

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published