You're viewing a comment by Tomaž Muraus and its responses.

April 29, 2010, 16:26

You could do it using the Twisted Python framework in a three lines or so (Twisted is asynchronous and event driven like nodejs) :)

Comment Responses

April 29, 2010, 17:11

Can you show me how to do it in 3 loc of Twisted?

May 06, 2010, 19:41

from twisted.web import proxy, http
from twisted.internet import reactor

class ProxyFactory(http.HTTPFactory):
protocol = proxy.Proxy

reactor.listenTCP(8080, ProxyFactory())

jherber Permalink
October 20, 2010, 02:18

Bah, this is pre-packaged class, not the actual proxy implemented in Twisted.

tom Permalink
December 28, 2011, 03:39

Um, what did you think the node.js one was? Did you not see the require('http') and require('sys') at the top?

Joe Permalink
April 26, 2017, 19:05

I think their point is that you could do this with nodejs in 3 lines too if you just use a packaged proxy. A "fair" comparison would be to just allow fundamental packages like http

Alexei Colin Permalink
July 13, 2013, 23:42

This twisted proxy supports HTTP 1.0 only.
They added a HTTP11ClientProtocol [1] in Twisted, but building a proxy on top of that would require a bunch more lines.


Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

Type the word "lcd_215": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.