简体   繁体   English

Facebook代理Web应用程序-它是好的架构/设计吗?

[英]Facebook proxy web application - Is it good architecture/design?

I am trying to build a java web application, which is a facebook app. 我正在尝试构建一个Java Web应用程序,这是一个Facebook应用程序。 Say this app is "Test App" on facebook and it is hosted and served from "xyz.com". 假设此应用是Facebook上的“测试应用”,它是由“ 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. 现在,我想使此Java应用程序在xyz.com上运行-有点通用-这个想法是创建N个应用程序“ Test App1”(托管在abc.com),“ Test App2”(托管在efg.com) )等(类似于某种服务),只需使用xyz.com上的一个web应用程序为每个应用程序提供GUI。 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. 因此,对于任何fb应用程序上的每个传入请求,xyz.com Web应用程序都会确定需要提供服务的应用程序,并向其打开GET请求,从中获取html响应,并将其作为自己的html响应的一部分包含在内。 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. “ Test App1”的用户-> iframe尝试加载xyz.com-> xyz.com应用程序上的servlet代码向abc.com打开HTTP GET请求->获取响应->将其包含在自己的响应中->发送响应。

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. 我有一种感觉,我正在尝试使其看起来像一个伪造的门户网站,xyz.com为每个传入请求都打开了一个新的HTTP Get,我认为当必须扩展时它将失败。 What is the best way to design this kind of a proxy web app - a) for flexibility (to serve more apps) b) for scalability. 设计这种代理Web应用程序的最佳方法是-a)灵活性(服务于更多应用程序)b)扩展性。

I think that this is not architectural issue. 我认为这不是体系结构问题。 Try to switch the point of view on the problem, for me it's about deployment. 尝试就问题交换观点,对我而言,这与部署有关。

You've designed an application and you want run it on different domains, is this right? 您已经设计了一个应用程序,并且想要在不同的域上运行它,对吗?

If true, you've at least these two options: 如果为true,则至少具有以下两个选项:

  • Act on web server configuration (if you decide for housing or you deploy in your organization). 对Web服务器配置采取行动(如果您决定容纳或在组织中部署)。

  • Act on configuration provided by your service host (if you decide for hosting ). 根据服务主机提供的配置进行操作(如果您决定托管 )。

About the legal question, sorry, I can't help you; 关于法律问题,很抱歉,我不能为您服务; but I can suggest to search facebook partnership guidelines (or try to ask to a facebook salesman). 但我建议您搜索Facebook合作伙伴指南(或尝试咨询Facebook推销员)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM