[OT] minimalist web server

Daniel Fetchinson fetchinson at googlemail.com
Sun Dec 2 23:13:16 EST 2007


> > The reason I need this is that my current best strategy to avoid ads in
> > web pages is putting all ad server names into /etc/hosts and stick my
> > local ip number next to them (127.0.0.1) so every ad request goes to my
> > machine. I run apache which has an empty page for 404 errors so I'll
>
> In this case, do you need a webserver at all? If your browser tries to
> access a web server on 127.0.0.1 and there isn't one, won't the result,
> in most cases, be more or less the same as if the server returned a 404?

Not quite, because if the browser doesn't get a response from the
server it will keep trying for a while and will only give up after
that. And then will display a "server not found, blablablabla" message
depending on the browser, which will appear in place of every ad.
That's ugly and it's better to have an empty page.

Concerning the python solutions posted by several guys, they are too
heavyweight compared to a ~ 1-3 hundred lines of C code that one can
obtain from cheetah's source code.



More information about the Python-list mailing list