Search in sources :

Example 1 with ProxyUtil

use of info.bitrich.xchangestream.util.ProxyUtil in project XChange by knowm.

the class BitmexWithProxyIT method setup.

@Before
public void setup() throws Exception {
    String execLine = PropsLoader.proxyExecLine();
    LOG.info("Running proxy with \"{}\" command", execLine);
    proxyUtil = new ProxyUtil(execLine, 5000);
    proxyUtil.startProxy();
    LocalExchangeConfig localConfig = PropsLoader.loadKeys("bitmex.secret.keys", "bitmex.secret.keys.origin", "bitmex");
    exchange = StreamingExchangeFactory.INSTANCE.createExchange(BitmexStreamingExchange.class);
    ExchangeSpecification exchangeSpecification = BitmexTestsCommons.getExchangeSpecification(localConfig, exchange.getDefaultExchangeSpecification());
    exchangeSpecification.setExchangeSpecificParametersItem(StreamingExchange.SOCKS_PROXY_HOST, "localhost");
    exchangeSpecification.setExchangeSpecificParametersItem(StreamingExchange.SOCKS_PROXY_PORT, 8889);
    exchange.applySpecification(exchangeSpecification);
    exchange.connect().blockingAwait();
}
Also used : ProxyUtil(info.bitrich.xchangestream.util.ProxyUtil) LocalExchangeConfig(info.bitrich.xchangestream.util.LocalExchangeConfig) ExchangeSpecification(org.knowm.xchange.ExchangeSpecification) Before(org.junit.Before)

Aggregations

LocalExchangeConfig (info.bitrich.xchangestream.util.LocalExchangeConfig)1 ProxyUtil (info.bitrich.xchangestream.util.ProxyUtil)1 Before (org.junit.Before)1 ExchangeSpecification (org.knowm.xchange.ExchangeSpecification)1