Websocket is not working
-
@rajanprabu said in Websocket is not working:
task='mw' #|'sfi'|'dp'
Do you find any documentation for this change ?
-
@rajanprabu because of you i checked their repo.and found that it is updated 4 days ago .. i will check whether i missed any updates thanks
-
I didnt check the header that its NodeJs.
-
Im sorry for the oversight.
-
@rajanprabu said in Websocket is not working:
Please dont roll back the SDK, otherwise this wont work.. This modification is true only smartapi-python version 1.2.2 onwards..
Hi i am a react-native dev(mobile app dev).so the node js sdk wont works for me since many of the packages are missing or in other name. so i gone through your code. and made in a form for me to work.i am following exactly same as the node js version
here you are providing example of python ver 1.2.2 for me for javascript the latest updated version is 1.0.9 -
@admin 9995527391, rohithmaccs@gmail.com
-
Please dont roll back the SDK, otherwise this wont work.. This modification is true only smartapi-python version 1.2.2 onwards..
-
If you have updated to the recent SDK.. You need to modify the script to have task included..
sample script below.. pay attention to
task='mw'
andws.send_request(token,task)
## WebSocket from smartapi import WebSocket FEED_TOKEN= "your feed token" CLIENT_CODE="your client Id" token="nse_cm|2885&nse_cm|1594&nse_cm|11536" task='mw' #|'sfi'|'dp' ss = WebSocket(FEED_TOKEN, CLIENT_CODE) def on_tick(ws, tick): print("Ticks: {}".format(tick)) def on_connect(ws, response): ws.send_request(token,task) def on_close(ws, code, reason): ws.stop() # Assign the callbacks. ss.on_ticks = on_tick ss.on_connect = on_connect ss.on_close = on_close ss.connect( )
-
hi @rohithmaccs Share your contact details to solve your issues.
-
Can you share your code ?