Can I get the websocket using simple javascript ?
-
@admin
I am able to get quotes using websocket in nodejs. But can I use the same in simple javascript.let { SmartAPI, WebSocket } = require("smartapi-javascript"); let web_socket = new WebSocket({ client_code: "****", feed_token: "****" }); web_socket.connect() .then(() => { // web_socket.runScript("nse_cm|2885", "cn") // SCRIPT: nse_cm|2885, mcx_fo|222900 TASK: mw|sfi|dp web_socket.runScript("nse_cm|2885", "mw") // setTimeout(function() { // web_socket.close() // }, 10000) }) web_socket.on('tick', receiveTick) function receiveTick(data) { console.log("receiveTick:::::", data) }
Please tell me how to get the live market feed in simple javascript.
-
@admin Does that mean I won't be able to use plain javascript for it ???
-
-
@admin which url ?
-
Hi @jety_22 kindly go through below url to know supported sdk.