如何使用Flex打开连接回服务器? [英] How do I open a connection back to the server using Flex?

查看:213
本文介绍了如何使用Flex打开连接回服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用Flex打开一个连接回服务器,这样我就可以将聊天消息流到Flex前端。我如何做到这一点,是否强制执行任何港口或子域的同源限制?

解决方案

您必须使用一个消息传递服务器软件,然后使用Flex框架中的Producer和Consumer类来发送和接收消息。

你需要什么取决于你在哪个服务器上运行。如果您使用Java堆栈,则可以使用 BlazeDS ActiveMQ



如果您是从到不同的域,您需要设置一个 crossdomain 文件,允许域间通信。

I want to open a connection back to the server using Flex so I can stream chat messages to the Flex front-end. How do I do this and does Flex enforce any same-origin restrictions on ports or subdomains?

解决方案

You'll have to use a messaging server software and then use the Producer and Consumer classes in the Flex framework to send and receive messages.

What you need depends on what server you are running on. If you are on a Java stack, you can use BlazeDS and ActiveMQ.

If you are streaming/consuming from and to different domains, you'll need to setup a crossdomain file that allows the inter-domain communication.

这篇关于如何使用Flex打开连接回服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆