通过HTTPS进行BlazeDS

tho*_*eye 3 apache-flex apache jboss blazeds

我正在尝试将BlazeDS配置为通过HTTPS工作.我们在前面设置了Apache,将所有http流量重定向到https.Apache然后通过http与应用程序(JBoss AS 5.1)通信.

我为BlazeDS尝试了很多配置,最后以下解决方案对我有用:

services-config.xml中

<services-config>
<services>
    <service-include file-path="remoting-config.xml" />
    <service-include file-path="messaging-config.xml" />
</services>

<channels>
    <channel-definition id="my-secure-amf"
        class="mx.messaging.channels.SecureAMFChannel">
        <endpoint
            url="https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure"
            class="flex.messaging.endpoints.AMFEndpoint" />
        <properties>
            <add-no-cache-headers>false</add-no-cache-headers>
        </properties>
    </channel-definition>
    </channels>
</services-config>
Run Code Online (Sandbox Code Playgroud)

远程-config.xml中

<service id="remoting-service" class="flex.messaging.services.RemotingService">

<adapters>
    <adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter" default="true"/>
</adapters>

<default-channels>
    <channel ref="my-secure-amf"/>
</default-channels>

<destination id="MyService" >
    <properties>
        <source>path.to.my.Service</source>
        <scope>application</scope>
    </properties>
</destination>
Run Code Online (Sandbox Code Playgroud)

这里的事情是在my-secure-amf频道中,我mx.messaging.channels.SecureAMFChannel在频道定义中使用,而flex.messaging.endpoints.AMFEndpoint不是(不flex.messaging.endpoints.SecureAMFEndpoint).这可能与Apache-Jboss设置有关,但我没有找到任何解释不同标签实际定义的内容.

为了在所有这些方面有所了解,有人可以解释在使用不同的网址和类定义频道和端点时会发生什么吗?

Cor*_*nga 5

它的工作原理是它正在创建一个SecureAMFChannel的Flex应用程序,并使用转码的url信息(url = https:// {server.name}:{server.port}/{context.root}/messagebroker/amfsecure)连接到你的Apache服务器.但是,由于Apache配置为使用HTTP连接到应用程序,因此您无法使用安全端点(端点将在您的网址方案前检查"https",如果找不到,则会抛出错误).

我在我的一个应用程序中使用完全相同的配置(我有一个硬件平衡器而不是Apache服务器).