Generally the application itself. Listening on an http port or a unix socket is pretty easy in most modern languages. Then use a normal HTTP server like apache to listen to incoming connections and proxy them on to whatever port on localhost your application is listening to.