Opening captive portal using uhttpd

I want to open up a captive portal using uhttpd..

I can use Lua or cgi.. both is fine..

The only prerequisite is , the process that gets called for serving the request from uhttpd must be a pre existing process.. a new process should not be spawned for the same..

The reason is, this process listens to some ongoing events and will attach some additional info to the url that it redirects to..

Just FYI, I have already done this using squid as a proxy.. but that AP had a higher RAM .. the one that I am targeting now would have max 64 mb ram.. I am not sure if squid will be able to run on that or not

Instead of uhttpd, if there is some other way taht could be done with a lower memory requirement that is fine as well