Igosuki / binance-rs-async

Async client for the Binance APIs
https://crates.io/crates/binance-rs-async
Other
184 stars 113 forks source link

Proxy support? #80

Closed Praying closed 8 months ago

Praying commented 1 year ago

some areas cannot access binance directly, so they need a proxy, does this project support it?

  1. REST API proxy
  2. websocket proxy
Igosuki commented 1 year ago

If you're using an http proxy or a load balancer you can simply use its host and port, so no difference here. If we're talking about a socks proxy, that can be added (https://docs.rs/reqwest/latest/reqwest/struct.Proxy.html)

Praying commented 1 year ago

websocket also need to be set

Igosuki commented 1 year ago

Your requirement is unclear, as using an http proxy would simply require changing the URL in the config. What kind of proxy are you accessing exactly ?

Praying commented 1 year ago

Websocket is different from rest, so they need different proxy setting

Igosuki commented 1 year ago

Can you give a real world example using docker or rust mimicking your issue that we can test connectivity against ?

On Mon, Feb 20, 2023, 16:51 Praying @.***> wrote:

Websocket is different from rest, so they need different proxy setting

— Reply to this email directly, view it on GitHub https://github.com/Igosuki/binance-rs-async/issues/80#issuecomment-1437227777, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADDFBQFWON4MG7N2C5QZW3WYOHHPANCNFSM6AAAAAAU43JYCE . You are receiving this because you commented.Message ID: @.***>

Praying commented 1 year ago

It seems not easy to test,which has strong correlation with country policy. But you should know that, reqwest and websocket has independent tcp connection, so reqwest set a proxy doesn't works for websocket.

Igosuki commented 1 year ago

That level of customisation would be best served by accessing the underlying client builder directly in the config, I need to think about it.

Praying commented 1 year ago

Do you has a discord or telegram? maybe we can talk about it more effectively.

Igosuki commented 1 year ago

Sure, https://discord.gg/KuUN9K9A

KennyYanXM commented 9 months ago

you can install proxychains4 and use following command to run behind a proxy: proxychains4 cargo run

Igosuki commented 8 months ago

no more news on this, closing.