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