//
//--------------------------------------------------------------------------
protected void setupContext(ProxyContext context, HTTPMessage message)
{
Target target = new Target();
context.setTarget(target);
context.setExternalProxySettings(externalProxy);
context.setProxyCredentials(proxyCredentials);
context.setConnectionManager(connectionManager);
context.setAllowLaxSSL(allowLaxSSL);
context.setContentChunked(contentChunked);
context.setRecordHeaders(message.getRecordHeaders());
context.setCookieLimit(cookieLimit);
context.setHttpRequest(FlexContext.getHttpRequest() != null);
//TODO: QUESTION: Pete, Send HTTPHeaders as real headers
// INPUT
String url = message.getUrl();
context.setUrl(url);
Map httpHeaders = message.getHttpHeaders();
context.setHeaders(httpHeaders);
String method = message.getMethod();
context.setMethod(method);
String contentType = message.getContentType();
context.setContentType(contentType);
Object body = message.getBody();
context.setBody(body);
target.setRemoteUsername(message.getRemoteUsername());
target.setRemotePassword(message.getRemotePassword());
HTTPProxyDestination destination = (HTTPProxyDestination)getDestination();
target.setUseCustomAuthentication(destination.isUseCustomAuthentication());
if (destination.getProtocolFactory() != null)
{
ProtocolFactory protocolFactory = destination.getProtocolFactory();
context.setProtocol(protocolFactory.getProtocol());