I am trying to build a java web application, which is a facebook app. Say this app is "Test App" on facebook and it is hosted and served from "xyz.com". Now, I would like to make this java app running at xyz.com - a little generic - The idea would be to create N apps "Test App1" (hosted at abc.com) , "Test App2" (hosted at efg.com) , and so on (kind of like a service), use just this one webapp at xyz.com to serve the GUI for each of these apps. So, for every incoming request on any of the fb apps, xyz.com webapp would identify which app needs to be served and open a GET request to it, get the html response from it, include it as part of its own html response. In short, this is how it is going to look like:
User of "Test App1" -> iframe tries to load xyz.com -> servlet code on xyz.com app opens a HTTP GET request to abc.com -> Gets response -> includes it in its own reponse -> sends response.
Does this make sense? Is this a good design at all? I have a feeling that I am trying to make it look like a fake portal, with xyz.com opening up a new HTTP Get for every incoming request, I think it will fail miserably when it has to scale. What is the best way to design this kind of a proxy web app - a) for flexibility (to serve more apps) b) for scalability.