Hello,
I had a running script to stream price data from Binance-Api, but for some reason it just stopped working and now returns:
“[WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond”.
Made no changes to my script, internet, IP or anything - just stopped working and it is now impossible to reconnect.
Code;
from binance.client import Client
import config
import websocket
client = Client(config.API_KEY, config.API_SECRET)
info = client.get_margin_account()
print(info)
SOCKET = f’wss://stream.binance.com:9443/ws/ethusdt@kline_1h/’
def on_open(ws):
print(‘opened connection’)
def on_close(was):
print(‘closed connection’)
def on_error(ws, error):
print(error)
def on_message(ws, message):
print(‘received message’)
ws = websocket.WebSocketApp(SOCKET, on_open=on_open, on_close=on_close, on_message=on_message, on_error=on_error)
ws.run_forever()
OUTPUT:
[WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
Thanks in advance for any help!