See now how start a WebSocket secure connection with a java client. First, create a WebSocket endpoint:
@ServerEndpoint(value = "/session") public class SessionSocketServer { ... @OnOpen public void onOpen(Session session) throws NamingException { ... } @OnMessage public String onMessage(String message, Session session) { return "Server received [" + message + "]"; } @OnClose public void onClose(Session session) { ... } @OnError public void onError(Throwable exception, Session session) { ... } }
And a basic WebSocket client:
public class SecureSocketClient extends Endpoint { ... private static final BlockingDeque<String> queue = new LinkedBlockingDeque<>(); @Override public void onClose( ...