Coldfusion CFWebsocket跨域?

Coldfusion CFWebsocket跨域?,coldfusion,websocket,coldfusion-10,Coldfusion,Websocket,Coldfusion 10,有人知道CF10中的新WebSocket功能是否可以跨域和跨服务器使用吗?有没有人知道或者有一些示例代码来实现这一点? 我在我的应用程序上有一个简单的实时帮助聊天,但我想将其应用到其他网站,并有一个中央管理员聊天区,支持代理将在其中与跨域用户进行交互。据我所知,他们没有。但是,您可以使用调用将发布消息的其他站点上的文件。这是我完成的 创建名为socketPublisher.cfm的文件,并将其保存在不需要登录即可访问文件的目录中 socketPublisher.cfm <cfparam n

有人知道CF10中的新WebSocket功能是否可以跨域和跨服务器使用吗?有没有人知道或者有一些示例代码来实现这一点?
我在我的应用程序上有一个简单的实时帮助聊天,但我想将其应用到其他网站,并有一个中央管理员聊天区,支持代理将在其中与跨域用户进行交互。

据我所知,他们没有。但是,您可以使用
调用将发布消息的其他站点上的文件。这是我完成的

创建名为socketPublisher.cfm的文件,并将其保存在不需要登录即可访问文件的目录中

socketPublisher.cfm

<cfparam name="Request.Attributes.msgType" default="newJob">
<cfparam name="Request.Attributes.channel" default="notify">
<cfparam name="Request.Attributes.Type" default="">
<cfoutput>
<cfswitch expression="#Request.Attributes.Type#">
    <cfcase value="yourType">
        <cfscript>
            WSPublish('chat',{message: '', msgType: '#Request.Attributes.msgType#'});
        </cfscript>
    </cfcase>
    <cfdefaultcase>
        <cfscript>
            WSPublish('#Request.Attributes.channel#',{message: '', msgType: '#Request.Attributes.msgType#'});
        </cfscript>
    </cfdefaultcase>
</cfswitch>
</cfoutput>
<cfhttp method="Post" url="#socketURL#/_scripts/socketPublisher.cfm">
    <cfhttpparam type="URL" name="msgType" value="pendingFiles">
</cfhttp>

WSPublish('chat',{message:'',msgType:'#Request.Attributes.msgType#'});
WSPublish('#Request.Attributes.channel#',{message:'',msgType:'#Request.Attributes.msgType#'});
然后,在另一个站点的操作页面中,您需要向该文件发出http请求

actionPage.cfm

<cfparam name="Request.Attributes.msgType" default="newJob">
<cfparam name="Request.Attributes.channel" default="notify">
<cfparam name="Request.Attributes.Type" default="">
<cfoutput>
<cfswitch expression="#Request.Attributes.Type#">
    <cfcase value="yourType">
        <cfscript>
            WSPublish('chat',{message: '', msgType: '#Request.Attributes.msgType#'});
        </cfscript>
    </cfcase>
    <cfdefaultcase>
        <cfscript>
            WSPublish('#Request.Attributes.channel#',{message: '', msgType: '#Request.Attributes.msgType#'});
        </cfscript>
    </cfdefaultcase>
</cfswitch>
</cfoutput>
<cfhttp method="Post" url="#socketURL#/_scripts/socketPublisher.cfm">
    <cfhttpparam type="URL" name="msgType" value="pendingFiles">
</cfhttp>

应该这样做

CF10
WSPublish
还有一个已知问题,即当尝试从操作页面重定向时,它将更改CGI范围并导致错误。在我找到更好的解决方案之前,我会将此作为解决该问题的变通方法