Web socket error for getting real-time order updates
-
I am getting an error while connecting to socket. This is the error:
An invalid or duplicated subprotocol was specified
Here is the version details:
SDK Version: 1.0.19
Node Version: 18.18.2
NPM Version: 9.8.1I also tried previous SDK versions but getting the same error.
Here is the actual code I am trying to use:
const { WebSocketClient } = require('smartapi-javascript') let web_socket = new WebSocketClient({ clientcode: 'XX123456', jwttoken: '...', apikey: '...', feedtype: 'order_feed', }) web_socket.connect().then(() => { web_socket.fetchData('subscribe', 'order_feed') setTimeout(function () { web_socket.close() }, 60000) }) web_socket.on('tick', receiveTick) function receiveTick(data) { console.log('receiveTick:::::', data) }