I have a problem with WebSocket to work on Wildfly 10, every time that I try send a message from Wildfly to the browser the connection is closed showing an 1006 code.
@ServerEndpoint("/debugger")
public class SocketDebugger {
@OnOpen
public void onConnect(Session session) {
session.setMaxIdleTimeout(0);
try {
session.getBasicRemote().sendText("Teste");
} catch (IOException e) {
e.printStackTrace();
}
}
}
This error does not occur if I open a WebSocket connection on a machine with Windows 7 or lower. Also on my machine with Windows 10, when I create a project using NodeJS Socket.IO communication works standard, this error happens with Java projects.