【发布时间】:2015-03-12 15:52:53
【问题描述】:
- 尝试在两个不同的 wildfly 实例上的两个单独的可部署战争之间建立 websocket 连接。
使用 tyrus-standalone-client 建立 websocket 连接到另一场战争。
下面是用来建立web-socket连接的sn-p
问题:是否有可能使 websocket 连接到另一个可部署的战争? 我运行时找不到任何异常,甚至没有 101-404 错误(握手错误)。
AuthConfig authConfig = AuthConfig.Builder.create().disableProvidedDigestAuth().build();
Credentials credentials = new Credentials("root", "xyz");
ClientManager client = ClientManager.createClient();
client.getProperties().put(ClientProperties.AUTH_CONFIG, authConfig);
client.getProperties().put(ClientProperties.CREDENTIALS, credentials);
try (Session session = client.connectToServer(GovernorNodeWebSocketClient.class, new URI("ws://10.203.67.168:8080/xyz"))) {
session.getBasicRemote().sendObject("xyz");
System.out.println("4sendMessageToRemoteGovernor :: sent the message from device services to the remote governor"+responseObject.getJson());
}
catch (Exception e) {
e.printStackTrace();
}
【问题讨论】:
-
是的……很有可能。
-
是的,谢谢,它可能对我有用。
标签: java websocket glassfish wildfly-8