not get response from websocket tested following code on other websocket website "wss://qa.sockets.stackexchange.com/" there it work but not work on "wss://websocket.kite.trade"
Following is my sample code for websocket try { String url = "wss://websocket.kite.trade/?api_key="+apikey+"&user_id="+uid+"&public_token="+PublicToken;
URI endpointURI = new URI(url);
SslContextFactory sslContextFactory = new SslContextFactory(); sslContextFactory.setTrustAll(true); // The magic
WebSocketClient client = new WebSocketClient(sslContextFactory);
is some thing wrong with session.getRemote().sendString("{\"a\": \"subscribe\", \"v\": [408065, 884737]}"); i send string and server need JSON or other format
Even if your sendString() is wrong (it has to be valid JSON), the connection should still be established. When you do client.connect(), is it establishing the connection or is there an error? Also, are you getting the 1-byte/sec heartbeat?
Finally, have you tried https://github.com/instruritesh/ZStreamingQuote ? It's a ready made Java Kite Connect WebSocket library.