-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ticker is Unable to connect. #44
Comments
Hello @vijay-arwapally , I think you need to apply 2 changes. replace with In the python package of zerodha - KiteTicket class / file name ticker.py change word access_token to enctoken replace with Please note the second change will be replaced if you update kite package in future. so we might need to apply this again each time we upgrade kite package. |
This worked for me, thanks |
Resolved. Thanks |
This is the hack with current code base:
diff --git a/jugaad_trader/zerodha.py b/jugaad_trader/zerodha.py
index f39e44a..fbc44a7 100644
--- a/jugaad_trader/zerodha.py
+++ b/jugaad_trader/zerodha.py
@@ -13,6 +13,7 @@ import pickle
import requests
import click
from six.moves.urllib.parse import urljoin
+import urllib.parse
from kiteconnect import KiteConnect, KiteTicker
import kiteconnect.exceptions as ex
@@ -50,7 +51,7 @@ class ZerodhaTicker(KiteTicker):
uid = int(time.time()) * 1000
self.socket_url = "{root}?api_key=kitefront&user_id={user_id}&enctoken={enc_token}&uid={uid}&user-agent=kite3-web&version=2.4.0".format(
- root=self.ROOT_URI, user_id=user_id, enc_token=enc_token, uid=uid
+ root=self.ROOT_URI, user_id=user_id, enc_token=urllib.parse.quote_plus(enc_token), uid=uid
)
The changes to |
Zerodha has changes the root for WebSocket. Please refer to this video for solution. |
Unable to connect to Ticker
Sample code being used.
Error
Connection error: 1006 - connection was closed uncleanly (WebSocket connection upgrade failed (400 - BadRequest))
Connection closed: 1006 - connection was closed uncleanly (WebSocket connection upgrade failed (400 - BadRequest))
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: