Symbian3/SDK/Source/GUID-AD6A057D-D514-4145-B7A6-E43959543E92.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Tue, 20 Jul 2010 12:00:49 +0100
changeset 13 48780e181b38
parent 0 89d6a7a84779
permissions -rw-r--r--
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-AD6A057D-D514-4145-B7A6-E43959543E92" xml:lang="en"><title>HTTP
Proxy Property</title><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>By default, a new <codeph>RHTTPSession</codeph> is set to make direct connections
to an origin server. To switch it to use a proxy, the following two properties
must be set: <codeph>HTTP::EProxyUsage</codeph> and <codeph>HTTP::EProxyAddress</codeph>. </p>
<ul>
<li id="GUID-6E1C24B1-590B-5FFE-8C00-FDF030B22B19"><p> <codeph>HTTP::EProxyUsage</codeph> can
take the values <codeph>HTTP::EDoNotUseProxy</codeph> (the default) or <codeph>HTTP::EUseProxy</codeph>. </p> </li>
<li id="GUID-DDAE87A1-A5E8-53CD-A6C7-464066930AB8"><p> <codeph>HTTP::EProxyAddress</codeph> must
be set using an <xref href="GUID-B886F0AA-DB9C-356C-9B96-33252820F93E.dita"><apiname>RStringF</apiname></xref> value that contains the proxy
address as an IP Address and port number separated by a colon, for example,
"10.158.7.4:9003". </p> </li>
</ul>
<codeblock id="GUID-D7CF5B00-1F32-5424-8B81-1C1B53E4E6D7" xml:space="preserve">void CHttpClient::SetProxyL(RStringF aProxyAddr)
    {
    RHTTPConnectionInfo connInfo = iSess.ConnectionInfo();
    THTTPHdrVal proxyUsage(iSess.StringPool().StringF(HTTP::EUseProxy,RHTTPSession::GetTable()));
    connInfo.SetPropertyL(iSess.StringPool().StringF(HTTP::EProxyUsage,RHTTPSession::GetTable()), proxyUsage);

    THTTPHdrVal proxyAddr(aProxyAddr);
    connInfo.SetPropertyL(iSess.StringPool().StringF(HTTP::EProxyAddress,RHTTPSession::GetTable()), aProxyAddr);

    Printf(_L("Proxy set to:%S\n\n"), &amp;iProxyName);
    }</codeblock>
<p>Changes made to the proxy settings will affect only new transactions opened
on the session, and not any currently in progress. </p>
<section id="GUID-AEA826D4-0F86-4817-8B06-BB0FA0799525"><title>Transaction proxy properties</title><p>A proxy setting can
be set for an individual transaction by setting the proxy properties on the
transaction. Proxy properties set on the transaction override any proxy properties
set on the session. </p></section>
</conbody></concept>