Facebook 本地测试:数据流向哪个方向?
这个问题不是关于如何设置本地环境来测试Facebook应用程序。相反,我已经在此线程的帮助下进行了设置。简而言之,我更改了主机文件并且它工作得很好。
但是,我有一个疑问:
假设:我在任何地方都读到过 Facebook 服务器的工作方式类似于代理,并从应用程序提供商的服务器获取网页(如 Web 服务),然后发送此内容将数据嵌入到浏览器。
出于测试目的,我更改了主机文件,如上面线程中提到的。我的问题是,如果 Facebook 服务器从我的网络服务器获取数据,那么我的浏览器在更改主机文件后如何在本地获取这些数据?
看来我的假设是错误的,或者我错过了一些基本的东西。请帮忙。谢谢。
This question is not about how to set up local environment to test Facebook application. Rather I've already set this up with the help of this thread. In short I changed my hosts file and its working great.
But, I've a got a doubt:
Assumption: Everywhere I've read that Facebook server works like a proxy and fetches web-pages, like a web service, from application provider's server and then sends this embedded data to browser.
For testing purposes, I've changed my hosts file like mentioned in above thread. My question is if Facebook server is fetching data from my web server then how come my browser gets this data locally after changing hosts file?
It seems either my assumption is wrong or I am missing something fundamental. Please help. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您正在构建 FBML 应用程序,Facebook 仅充当代理服务器。如果您正在构建 iFrame 应用程序,则对应用程序的请求直接来自客户端浏览器。您可以通过实际将画布网址设置为 http://localhost:8080/ 并运行您的应用程序来测试这一点本地。您将能够像平常一样运行该应用程序,但显然只有您才能使用它,因为它位于本地主机上。
Facebook only acts as a proxy server if you are building an FBML app. If you are building an iFrame app, the request to your application is coming directly from the client browser. You can test this out by actually setting your canvas url to something like http://localhost:8080/ and running your app locally. You will be able to run the application like normal, but obviously only you will be able to use it since it is on localhost.