You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not able to connect to socket to retrieve live price feed
Error log:-
Traceback (most recent call last):
File "/stream/fetch_data.py", line 44, in <module>
api.ws_connect()
File "/.venv/lib/python3.12/site-packages/breeze_connect/breeze_connect.py", line 56, in ws_connect
self.sio_handler.connect()
File "/.venv/lib/python3.12/site-packages/breeze_connect/breeze_connect.py", line 21, in connect
self.sio.connect(self.hostname, headers={"User-Agent": "python-socketio[client]/socket"}, auth=auth, transports="websocket", wait_timeout=3)
File "/.venv/lib/python3.12/site-packages/socketio/client.py", line 159, in connect
raise exceptions.ConnectionError(exc.args[0]) from None
socketio.exceptions.ConnectionError: Connection error
code :-
from breeze_connect import BreezeConnect
from dotenv import load_dotenv
import os
import pandas as pd
load_dotenv()
# intialize keys
api_key = os.getenv("API_KEY")
api_secret = os.getenv("SECRET")
api_session = os.getenv("SESSION")
# Import Libraries
from datetime import datetime
import pandas as pd
from breeze_connect import BreezeConnect
# Setup my API keys
api = BreezeConnect(api_key=api_key)
api.generate_session(api_secret=api_secret, session_token=api_session)
print("session created")
def on_ticks(ticks):
print(ticks)
# Main Function
if __name__ == "__main__":
print("Starting Execution \n")
# Switch on Websockets
api.ws_connect()
api.on_ticks = on_ticks
api.subscribe_feeds(stock_token = "one_click_fno")
The text was updated successfully, but these errors were encountered:
Not able to connect to socket to retrieve live price feed
Error log:-
The text was updated successfully, but these errors were encountered: