sonvister / Binance

A .NET Standard Binance API library.
MIT License
229 stars 77 forks source link

Using Proxy #98

Closed mehranrezaei closed 6 years ago

mehranrezaei commented 6 years ago

How can i set proxy for this library?

sonvister commented 6 years ago

@mehranrezaei, if you are asking if there is a way to change the endpoint URL (https://api.binance.com) programmatically, there is not. Can you elaborate on what you need and why?

mehranrezaei commented 6 years ago

I mean how to set a HTTP proxy for this library. For example This project uses WebSocket4Net or WebSocketSharp for receiving socket streams. I need to set HTTP proxy for this sockets.

sonvister commented 6 years ago

@mehranrezaei, actually this project uses System.Net.WebSockets.ClientWebSocket by default. Those others you mentioned are alternatives for Windows 7 compatibility.

The Binance.WebSocket.IClientWebSocket interface does not expose the underlying web socket client implementation (there is no common interface) and only provides what is necessary for the library.

So, if there is a way to set HTTP proxy with any of the web socket client libraries it is not accessible.

sonvister commented 6 years ago

BTW, for anyone wanting this feature (if possible ...I have not looked into this) in order to bypass Binance IP ban usage restrictions, know that I have no intention of helping anyone to unfairly use the Binance API.