Hi,
Facing issue in websocket. here is my code.
Output : Connected To websocket but not receiving any data.
Also logged in Successfully and generated Token as well.
let web_socket = new WebSocketClient({
clientcode: CLIENT_CODE,
jwttoken: JWT_TOKEN,
apikey: API_KEY,
feedtype: "order_feed",
script:"nse_cm|11536"
});
web_socket.connect()
.then(() => {
var ACTION_TYPE = "subscribe";
var FEED_TYPE = "order_feed";
console.log("Connected to Web Socket");
web_socket.fetchData(ACTION_TYPE,FEED_TYPE); // ACTION_TYPE: subscribe | unsubscribe FEED_TYPE: order_feed
setTimeout(function () {
web_socket.close()
}, 60000)
});
web_socket.on('tick', receiveTick);
function receiveTick(data) {
console.log("receiveTick:::::", data);
}