java-etherscan-api icon indicating copy to clipboard operation
java-etherscan-api copied to clipboard

I want to use http proxy

Open brezze2018 opened this issue 2 years ago • 1 comments

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.

brezze2018 avatar Jun 21 '23 06:06 brezze2018

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();

GoodforGod avatar Aug 10 '23 06:08 GoodforGod