Page 1 of 1

http requests behind a proxy fails

Posted: 16 Jun 2016, 12:32
by Jay Freeman
I originally asked a question in support regarding proxies (http://forum.madsonic.org/viewtopic.php?f=62&t=1828)

Seems this is a genuine bug, so I'm reporting it here also.

Calls to HttpGet should be passed a proxy via the RequestCofig object.

Code: Select all

   HttpGet method = new HttpGet(url);
   HttpHost proxy = new HttpHost(httpProxy, httpProxyPort, "http");
   RequestConfig requestConfig = RequestConfig.custom()
      .setProxy(proxy)
      .setSocketTimeout(timeout)
      .setConnectTimeout(timeout)
      .setConnectionRequestTimeout(timeout)
      .build();
   method.setConfig(requestConfig);
Thanks

Re: http requests behind a proxy fails

Posted: 16 Jun 2016, 12:57
by Jay Freeman
Equally, LAstFMService.java never sets the proxy, even though there is a setProxy method.