Skip to content

Exception(except_message.LIVESTREAM_SOCKET_CONNECTION_DISCONNECTED.value) Exception: Failed to connect to live stream #7

Description

@vivekpatel328

Hi Breeze Team,

I am writing to report a bug encountered while using the Breeze-Python-SDK.

Issue Description:
When attempting to establish a websocket connection using the SDK, the following exception is raised:

Exception(except_message.LIVESTREAM_SOCKET_CONNECTION_DISCONNECTED.value) Exception: Failed to connect to live stream.

#Below is the code
`

from breeze_connect import BreezeConnect
from time import sleep
import os
import threading

api_key = os.getenv("BREEZE_API_KEY")
api_secret = os.getenv("BREEZE_API_SECRET")
session_token = "51787546"

breeze = BreezeConnect(api_key=api_key)

def on_ticks(tick):
print("Ticks: {}".format(tick))

breeze.on_ticks = on_ticks

breeze.generate_session(api_secret=api_secret, session_token=session_token)

]
breeze.ws_connect()

sleep(2) # Wait for connection to establish

breeze.subscribe_feeds(
exchange_code="NFO",
stock_code="NIFTY",
expiry_date="2025-06-12", # Format: YYYY-MM-DD
strike_price="25000",
right="put",
product_type="options",
get_market_depth=False,
get_exchange_quotes=True,
)

threading.Event().wait()`

Feel free to connect on vmpatel328@gmail.com if more details needed.

WR,
Vivek Patel.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions