On 02/05/2013 10:06 PM, Sven Geggus wrote: > Hello, > > would it be complex to implement a very simple reverse proxy using > libmicrohttpd? > > All I would need would be something like this: > > http://myserver/ -> index.html > http://myserver/foo -> http://localhost:port1 > http://myserver/bar -> http://localhost:port2 > > Maybee using something like a combination of libmicrohttpd and libcurl? > > Did anybody already do this?
Not AFAIK, but we have very specific plans to do exactly this in GNUnet this year --- except that we'll be rewriting the result from libcurl as it passes the reverse proxy and only go to one particular HTTP server instead of different targets. So I fully believe this is possible. The main "mess" is that you will have to write special logic for each HTTP method (PUT, POST, etc.) and convert the inputs and outputs from MHD to CURL and back. If you just care about "GET", this should not take much. If you want to also support PUT and POST, I expect it to be a bit bigger. If you are doing a free software implementation of such a reverse proxy, I might be interested in the code ;-). Happy hacking! Christian