python reverse proxy spawning via cgi
<p>I need to write a cgi page which will act like a reverse proxy between the user and another page (mbean).  The issue is that each mbean uses different port and I do not know ahead of time which port user will want to hit.<br>
Therefore want I need to do is following:
A) Give user a page which will allow him to choose which application he wants to hit
B) spawn a reverse proxy base on information above (which gives me port, server, etc..)
C) the user connects to the remote mbean page via the reverse proxy and therefore never "leaves" the original page.<br>
The reason for C is that user does not have direct access to any of the internal apps only has access to initial port 80.</p>

<p>I looked at twisted and it appears to me like it can do the job.  What I don't know is how to spawn twisted process from within cgi so that it can establish the connection and keep further connection within the reverse proxy framework.</p>

<p>BTW I am not married to twisted, if there is another tool that would do the job better, I am all ears.  I can't do things like mod_proxy (for instance) since the wide range of ports would make configuration rather silly (at around 1000 different proxy settings).</p>
