开发者

can a Flash app running in browser connect to localhost to get data from another app?

it seems that Flash was supposed to run in a sandbox in the browser. But, if Flash can get data from a remote server, can it similarly get data from localhost IP on the same machine? In other words, can I use a Windows app that provides a TCP socket on localhost to feed data into a Flash app?

EDITED:

ok, the answer is yes at least for the case of an SWF file hosted in the file system, see here http://www.flashsecrets.com/2008/01/security-sandbox-violation-w-localhost.html (turns out the localhost access error can be fixed if you add th开发者_运维知识库e SWF app to some security whitelist). Still wondering if this can also be done for SWF apps hosted on the network.


Yes it can be done. Two caveats:

  • You must launch the server yourself (Flash's sandbox doesn't allow you to start the server)
  • You must serve up a crossdomain policy file from the server
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜