gpt4 book ai didi

apache-flex - 通过 HTTPS 的 BlazeDS

转载 作者:行者123 更新时间:2023-12-01 06:52:55 24 4
gpt4 key购买 nike

我正在尝试将 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>

remoting-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>

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

为了理解所有这些,有人可以解释一下在使用不同的 url 和类定义 channel 和端点时会发生什么吗?

最佳答案

之所以有效,是因为 Flex 应用程序正在创建 SecureAMFChannel 并使用转码后的 url 信息 (url = https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure)连接到您的 Apache 服务器。但是,由于 Apache 配置为使用 HTTP 连接到应用程序,因此您不能使用安全端点(端点将检查您的 url 方案前面的“https”,如果未找到,它将抛出错误)。

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

关于apache-flex - 通过 HTTPS 的 BlazeDS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7658961/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com