Re:A HTTP Proxy Server in 20 Lines of node.js Code
by TimothyFitz on Wednesday April 28, 2010 @12:19PM
(#1301908)
Not quite accurate. The code he wrote does the "proxy" logic while libraries underneath it are doing the work of parsing HTTP. He's definitely not doing "calls into a lib that implements an http proxy."
More to the point, what he has is a proxy in 20 lines of code which will let him make, say, a custom load balancing http proxy in 40 lines of code.
Re:A HTTP Proxy Server in 20 Lines of node.js Code
by simonw on Wednesday April 28, 2010 @09:15AM
(#1301451)
I think this does show something that can't be done easily with Apache: scripting decisions about what to proxy in JavaScript, in this case to implement auto-reloading of configuration files for IP filtering and regex-based host blacklisting.
The examples could be implemented in fewer lines of Apache configuration. I would have been nice with some examples that shows what node.js can do, which can't be done (easily) with Apache.