* @param context the context
*/
protected void setupRequest(ProxyContext context)
{
// set the proxy to send requests through
ExternalProxySettings externalProxy = context.getExternalProxySettings();
if (externalProxy != null)
{
String proxyServer = externalProxy.getProxyServer();
if (proxyServer != null)
{
context.getTarget().getHostConfig().setProxy(proxyServer, externalProxy.getProxyPort());
if (context.getProxyCredentials() != null)
{
context.getHttpClient().getState().setProxyCredentials(ProxyUtil.getDefaultAuthScope(), context.getProxyCredentials());
}
}