【问题标题】:How to change host url websocket configurations?如何更改主机 url websocket 配置?
【发布时间】:2021-10-04 23:29:36
【问题描述】:

我对 websocket 客户端 url 有疑问。我想为我的客户端机器使用远程 websocket 服务器。

Machine1, Machine2 --->  Remote Websocket Server

我有一个这样的 websocket 配置。

<websocket:message-broker application-destination-prefix="/app">
    <websocket:stomp-endpoint path="/stomp" allowed-origins="*">
    <websocket:handshake-handler ref="myHandshakeHandler"/>
        <websocket:sockjs client-library-url="https://cdn.jsdelivr.net/npm/sockjs-client@1/dist/sockjs.min.js"/>
    </websocket:stomp-endpoint>
            
    <websocket:simple-broker prefix="/topic,/queue"/>
    <websocket:client-inbound-channel>
        <websocket:interceptors>
            <ref bean="myInterceptor"/>
        </websocket:interceptors>
    </websocket:client-inbound-channel>
</websocket:message-broker>

我想发布并获取 websocket 操作的远程 url,这样我就可以多台我的 gui 机器。如何将websocket主机urllocalhost改为https://remotemachineurl:61614

【问题讨论】:

  • 谢谢贾斯汀,你帮了我很多。删除 artemis 标签时。 :)

标签: stomp spring-websocket


【解决方案1】:

我在我的xml中添加了这个配置,我可以连接远程activemq artemis。

<websocket:stomp-broker-relay prefix="/topic,/queue" relay-host="remotehost" relay-port="61614"/>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-06-27
    • 1970-01-01
    • 2020-04-17
    • 1970-01-01
    • 2013-08-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多