Websocket-Client: Connection Issues

Hei there,

i want to use my websocket-client to get infinite data from the binance future websocket.
The Code runs perfectly and i get the data. But at some point (always different) i get disconnected from the Host.
I dont know why, maybe its because there is to much traffic from all the users?

Im using Python 3, with the Websocket-client module.
See below the stream-url im going to call.

wss://fstream.binance.com/stream?streams=btcusdt_perpetual@continuousKline_1m/btcusdt_perpetual@continuousKline_5m

I have already done a lot of research on the error I encountered, but nothing helpful!!
Is anyone else getting problems like this? Or has an idea how to get around?
I need to receive data 24/7 from the websocket.

Thanks for advice

With following simple command line, I’m not able to reproduce the described issue:

websocat "wss://fstream.binance.com/stream?streams=btcusdt_perpetual@continuousKline_1m/btcusdt_perpetual@continuousKline_5m"

You might want to reach out to authors/community of websocket-client to understand the problem as we’re not familiar with the library in depth.

hei aisling, thanks for your answer!

how long did you have your request connected to the websocket?
I am in contact with the author of websocket-client and we know that its not a problem of the python module. Its maybe a problem on the hostside(to much traffic so some users get disconnected) or with my network(firewall etc.).

My longest active connection was around 17 hours before i got disconnected.
One raised error was:
[WinError 10054] An existing connection was forcibly closed by the remote host

and the second Error on my Macbook was:
ping/pong timed out

i am sending every 60 seconds a PONG to the server and getting back a PING every 5 Minute. Suddenly the connection get disconnected. Do i have to do something else, to keep it alive?

I am relatively new and unfamiliar to the network, https, websocket space.

Cheers

Chris