Abnormal Closure with Futures Websocket

Hi, I am getting a peculiar error when getting order books for BTCUSDT and ETHUSDT by websocket connection. The strange thing is that this error only appears for these two pairs and for no other. My client is written in Golang with the package gorilla for websockets.

The error is: websocket: close 1006 (abnormal closure): unexpected EOF

I have already checked and there are no more than 10 requests per second, I am sending a PONG frame on every PING received and this still happens.

If you have any idea of what the problem could be it would be awesome.


Hello, we haven’t seen other reports on this, so it’s hard to say the reason. Maybe there’s an interference (firewall, proxy, …) in the middle of transmission from Binance to your local machine that can affect? What is the stream? Have you tried the connection using another package or region?
Also note that there’s a max of 200 streams per connection.

I was trying with app. 220 different connections, each connection read the Order Book for one pair. The first connection open was always the first to get closed. I then changed the number of connections to 50 and it worked for a little over an hour, but then again the first open connection got closed with a 1006 code.

Maybe the issue could be that the ReadMessage function used from gorilla (golang) keeps an open stream and thats the reason for connections to get closed after a while? The thing that makes me wonder would be the reason to why with less simultaneously open connections it takes longer for them to fail…

I just tried using every pair except for btcusdt and ethusdt and it works with no trouble at all. This suggests that the code is actually fine, and the real problem could be with these two pairs (only in futures market, not in spot)

I hope this helps you help me.

Thanks again!

Still waiting for an answer…

I can report the same problem as well. Using aiohttp, python 3.8, connecting to !bookTicker only. Connection is disconnected with 1006 EOFstream error every 5-15 minutes. @Tomas_Morales any progress with this issue?

Thanks in advance