Again thanks for your help!
Just a summary of my changes to make websockets consumer working through http proxy:
- modified HttpClient inside ApiClient.java to use HTTP proxy (as mentioned by victor.duan above);
- modified WebSocketsConnection.java to create socket via ProxyClient class:
ProxyClient proxyClient = new ProxyClient();
HttpHost target = new HttpHost(host, port);
HttpHost proxy = new HttpHost(proxyHost, proxyPort);
UsernamePasswordCredentials credentials = new UsernamePasswordCredentials(“user”, “pwd”);
return proxyClient.tunnel(proxy, target, credentials);
Please note that to use ProxyClient class HttpComponents libraries should be upgraded to version 4.2.1
However it is not easy to maintain my own version of DataSift client library and it will require merging if I want to use latest features from your official library in future so I am looking forward to see these useful features in the official version on github. Thank you!