Posts Tagged python

Reverse Proxy for RaspberryPi


At the moment I am using anyway nginx as it’s kind of very easy to configure and does absolutely everything I need with almost no resource usage.
More information on the configuration can be found on its post.

I have various web services that run on my raspberry pi, probably like many other raspberry users out there.

I used Apache and lighttpd as reverse proxies to avoid opening many ports (and remembering them after) but instead just use one. But, having only 256MB of ram and seeing that usually both application consumed more quite some memory, while being anyway most of the time unused I wrote a tiny alternative in python. It works even with pypy, but that will just make you lose the memory saving advantage, so at that point you can just keep on using the reverse proxies I mentioned.

The program itself is not complete yet for my needs; I am planning to add direct SSL support and a tiny web server to serve an index of the various services I have, and IPv6 on the server side (it will try to connect to IPv6 clients if possible already)

So far I have managed to consume 1/3 less of ram of what lighttpd was using with no issues. I was even thinking about a possible xinetd version of it, but that would be probably even worse considering how many connection modern borwser create.. it will most probably just kill the machine forking too much or making the browser unable to open enough connections.. I’ll do some tests

You can find the link to the project in the code page or just here git://


Leave a comment