Handshake status 504 Gateway Time-out -+-+- {'date': 'Wed, 08 Nov 2023 06:59:03 GMT', 'content-type': 'text/html', 'transfer-encoding': 'chunked', 'connection': 'keep-alive', 'set-cookie': 'XXXXXXXXXXXXXXXXXXXXXXX; Expires=Wed, 15 Nov 2023 06:58:53 GMT; Path=/; AWSALBTGCORS=XXXXXXXXXXXXXXXXXXXXXXXXXXXXX; Expires=Wed, 15 Nov 2023 06:58:53 GMT; Path=/; SameSite=None; Secure; __cf_bm=XXXXXXXXXXXXXXXXXXX; path=/; expires=Wed, 08-Nov-23 07:29:03 GMT; domain=.fyers.in; HttpOnly; Secure', 'cf-cache-status': 'DYNAMIC', 'server': 'cloudflare', 'cf-ray': '822bee188b23178a-MAA'} -+-+- None
Code:
fyers = data_ws.FyersDataSocket(
access_token=cache.get('access_token'), # Access token in the format "appid:accesstoken"
log_path="", # Path to save logs. Leave empty to auto-create logs in the current directory.
litemode=False, # Lite mode disabled. Set to True if you want a lite response.
write_to_file=False, # Save response in a log file instead of printing it.
reconnect=True, # Enable auto-reconnection to WebSocket on disconnection.
on_connect=onopen, # Callback function to subscribe to data upon connection.
on_close=onclose, # Callback function to handle WebSocket connection close events.
on_error=onerror, # Callback function to handle WebSocket errors.
on_message=onmessage # Callback function to handle incoming messages from the WebSocket.
)