on 07-Sep-2013 12:56
The demo below was created by one of the LineRate developers on a Friday hack-a-thon day. The goal for the day was to create fun demos of some Node.js modules using LineRate Proxy. This demo shows the power of using LineRate Proxy to intercept and filter or redirect HTTP requests based on the Proxy requesting additional XML data from an off-box service.
For the full description and actual code to implement this cool demo, see the full posting on Github.
http://en.wikipedia.org/w/index.php?title=Chunked_transfer_encoding
POST /w/index.php?title=Special:Export&pages=Chunked_transfer_encoding&&offset=0&limit=5&action=submit&dir=desc 1.1The POST is a Wikipedia requirement to get full version information, even though the body of the POST is empty. The HTTP response has a body in XML. The xml2js node module parses it into a javascript object, and the script can walk into the object and find the revisions and authors.
Host: en.wikipedia.org
Accept: */*
Content-Length: 0
HTTP/1.1 302 Found Location: http://en.wikipedia.org/w/index.php?title=Chunked_transfer_encoding?oldid=563242545 Content-Length: xxx <html><head><title>Redirecting Chunked_transfer_encoding</title></head> <body> <h1>Redirecting to a human-edited version</h1> <p>The last version of Chunked_transfer_encoding was edited by an anonymous user.</p> <p>Redirecting to the last human-edited version: <a href="...">...</a></p> </body></html>