GoodforGod / java-etherscan-api

🔗 Polished Java library for EtherScan.io API
https://etherscan.io
MIT License
56 stars 41 forks source link

I want to use http proxy #26

Open brezze2018 opened 1 year ago

brezze2018 commented 1 year ago

Is your feature request related to a problem? Please describe. I want to use http proxy

Describe the solution you'd like I want to add a proxy parameter to io.goodforgod.api.etherscan.http.impl.UrlEthHttpClient to set the http proxy.

Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 1080)); UrlEthHttpClient .proxy = proxy;

Describe alternatives you've considered make a copy https://github.com/GoodforGod/java-etherscan-api/blob/master/src/main/java/io/goodforgod/api/etherscan/http/impl/UrlEthHttpClient.java

Additional context Add any other context or scre 20230621144948 enshots about the feature request here.

GoodforGod commented 1 year ago

Library allow to use your custom HttpClient implementation cause EthHttpClient is an interface, you can easily provide your custom impl to Etherscan.builder and this will do the trick

Supplier<EthHttpClient> ethHttpClientSupplier = // your client implementation
EtherScanAPI api = EtherScanAPI.builder()
    .withHttpClient(supplier)
    .build();