JKorf / Binance.Net

A C# .netstandard client library for the Binance REST and Websocket Spot and Futures API focusing on clear usage and models

Home Page:https://jkorf.github.io/Binance.Net/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BinanceSocketClient - Can't connect to the server

AlgoExecutor opened this issue · comments

Looks like there is a problem with BinanceClientSocket class. When I call the endpoint GetServerTime I get: Can't connect to the server
Binance.Net Version 9.7.1

You can easily reproduce it with the following code:

 var socketClient = new BinanceSocketClient();
 var time = socketClient.SpotApi.ExchangeData.GetServerTimeAsync().Result;
 if(!time.Success)
     Console.WriteLine("Error: " + time.Error);

Debug Logging:
fail: Binance[1001]
[Sckt 1] connection failed: The server returned status code '403' when status code '101' was expected.
System.Net.WebSockets.WebSocketException (203): The server returned status code '403' when status code '101' was expected.
at System.Net.WebSockets.WebSocketHandle.ConnectAsync(Uri uri, CancellationToken cancellationToken, ClientWebSocketOptions options)
at System.Net.WebSockets.ClientWebSocket.ConnectAsyncCore(Uri uri, CancellationToken cancellationToken)
at CryptoExchange.Net.Sockets.CryptoExchangeWebSocketClient.ConnectInternalAsync()

Ups, maybe i got blocked somehow.