I have the following WebSocket
client code in Java.
final ClientEndpointConfig cec = ClientEndpointConfig.Builder.create().build();
ClientManager client = ClientManager.createClient();
client.connectToServer(new Endpoint() {
@Override
public void onOpen(Session session, EndpointConfig config) {
try {
session.addMessageHandler((MessageHandler.Whole<String>) message -> {
System.out.println("Received message: "+message);
});
session.getBasicRemote().sendText(SENT_MESSAGE);
} catch (IOException e) {
e.printStackTrace();
}
}
}, cec, new URI("wss://ws.bitso.com"));
} catch (Exception e) {
e.printStackTrace();
}
For some reason, I'm getting this error.
org.glassfish.tyrus.core.HandshakeException: Response code was not 101: 400
What could be the reason?