0

When i'm trying to send request via jetty httpClient with new Socks4Proxy(socksHost, socksPort); received: java.util.concurrent.ExecutionException: java.io.IOException: SOCKS4 tunnel failed with code 91

HttpClient httpClient = new HttpClient();
ProxyConfiguration proxyConfig = httpClient.getProxyConfiguration();
Socks4Proxy proxy = new Socks4Proxy(socksHost, socksPort);
proxyConfig.getProxies().add(proxy);

httpClient.start();

String url = config.getProperty(stringUrl);
Request request = httpClient.newRequest(url);
request.method(HttpMethod.GET);
request.onResponseContent(new BufferingResponseListener() {
    @Override
    public void onComplete(Result result) {
        String s = getContentAsString();
        logger.debug("Received http response message: '{}', status: '{}'", s, result.getResponse().getReason());
    }
});

try {
    request.send();
} catch (Exception e) {
    throw new RuntimeException(e);
}
Joakim Erdfelt
  • 46,896
  • 7
  • 86
  • 136

1 Answers1

0

Per https://www.openssh.com/txt/socks4.protocol

Your 91 status means that request was rejected or failed. The user or source program is not authorized to access the proxy server.

Perhaps your SOCKS4 proxy has an authentication requirement.

Joakim Erdfelt
  • 46,896
  • 7
  • 86
  • 136