Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > 1dd17e0d683ef79b4bb6872bbf359d7f > files > 6070

qt4-doc-4.8.7-26.2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qnetworkproxy.cpp -->
  <title>Qt 4.8: QNetworkProxy Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtnetwork.html">QtNetwork</a></li>
<li>QNetworkProxy</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#socks5">SOCKS5</a></li>
</ul>
</div>
<h1 class="title">QNetworkProxy Class Reference</h1>
<!-- $$$QNetworkProxy-brief -->
<p>The QNetworkProxy class provides a network layer proxy. <a href="#details">More...</a></p>
<!-- @@@QNetworkProxy -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QNetworkProxy&gt;</span></pre><p><b>Note:</b> All functions in this class are <a href="threads-reentrancy.html#reentrant">reentrant</a>.</p>
<p>This class was introduced in Qt 4.1.</p>
<ul>
<li><a href="qnetworkproxy-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> flags </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxy.html#Capability-enum">Capabilities</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxy.html#Capability-enum">Capability</a></b> { TunnelingCapability, ListeningCapability, UdpTunnelingCapability, CachingCapability, HostNameLookupCapability }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxy.html#ProxyType-enum">ProxyType</a></b> { NoProxy, DefaultProxy, Socks5Proxy, HttpProxy, HttpCachingProxy, FtpCachingProxy }</td></tr>
</table>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxy.html#QNetworkProxy">QNetworkProxy</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxy.html#QNetworkProxy-2">QNetworkProxy</a></b> ( ProxyType <i>type</i>, const QString &amp; <i>hostName</i> = QString(), quint16 <i>port</i> = 0, const QString &amp; <i>user</i> = QString(), const QString &amp; <i>password</i> = QString() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxy.html#QNetworkProxy-3">QNetworkProxy</a></b> ( const QNetworkProxy &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxy.html#dtor.QNetworkProxy">~QNetworkProxy</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Capabilities </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxy.html#capabilities">capabilities</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxy.html#hostName">hostName</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxy.html#isCachingProxy">isCachingProxy</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxy.html#isTransparentProxy">isTransparentProxy</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxy.html#password">password</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> quint16 </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxy.html#port">port</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxy.html#setCapabilities">setCapabilities</a></b> ( Capabilities <i>capabilities</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxy.html#setHostName">setHostName</a></b> ( const QString &amp; <i>hostName</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxy.html#setPassword">setPassword</a></b> ( const QString &amp; <i>password</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxy.html#setPort">setPort</a></b> ( quint16 <i>port</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxy.html#setType">setType</a></b> ( QNetworkProxy::ProxyType <i>type</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxy.html#setUser">setUser</a></b> ( const QString &amp; <i>user</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QNetworkProxy::ProxyType </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxy.html#type">type</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxy.html#user">user</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxy.html#operator-not-eq">operator!=</a></b> ( const QNetworkProxy &amp; <i>other</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QNetworkProxy &amp; </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxy.html#operator-eq">operator=</a></b> ( const QNetworkProxy &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxy.html#operator-eq-eq">operator==</a></b> ( const QNetworkProxy &amp; <i>other</i> ) const</td></tr>
</table>
<a name="static-public-members"></a>
<h2>Static Public Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QNetworkProxy </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxy.html#applicationProxy">applicationProxy</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxy.html#setApplicationProxy">setApplicationProxy</a></b> ( const QNetworkProxy &amp; <i>networkProxy</i> )</td></tr>
</table>
<a name="details"></a>
<!-- $$$QNetworkProxy-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QNetworkProxy class provides a network layer proxy.</p>
<p>QNetworkProxy provides the method for configuring network layer proxy support to the Qt network classes. The currently supported classes are <a href="qabstractsocket.html">QAbstractSocket</a>, <a href="qtcpsocket.html">QTcpSocket</a>, <a href="qudpsocket.html">QUdpSocket</a>, <a href="qtcpserver.html">QTcpServer</a>, <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a> and <a href="qftp.html">QFtp</a>. The proxy support is designed to be as transparent as possible. This means that existing network-enabled applications that you have written should automatically support network proxy using the following code.</p>
<pre class="cpp"> <span class="type">QNetworkProxy</span> proxy;
 proxy<span class="operator">.</span><a href="qnetworkproxy.html#setType">setType</a>(<span class="type">QNetworkProxy</span><span class="operator">::</span>Socks5Proxy);
 proxy<span class="operator">.</span><a href="qnetworkproxy.html#setHostName">setHostName</a>(<span class="string">&quot;proxy.example.com&quot;</span>);
 proxy<span class="operator">.</span><a href="qnetworkproxy.html#setPort">setPort</a>(<span class="number">1080</span>);
 proxy<span class="operator">.</span><a href="qnetworkproxy.html#setUser">setUser</a>(<span class="string">&quot;username&quot;</span>);
 proxy<span class="operator">.</span><a href="qnetworkproxy.html#setPassword">setPassword</a>(<span class="string">&quot;password&quot;</span>);
 <span class="type">QNetworkProxy</span><span class="operator">::</span><a href="qnetworkproxy.html#setApplicationProxy">setApplicationProxy</a>(proxy);</pre>
<p>An alternative to setting an application wide proxy is to specify the proxy for individual sockets using <a href="qabstractsocket.html#setProxy">QAbstractSocket::setProxy</a>() and <a href="qtcpserver.html#setProxy">QTcpServer::setProxy</a>(). In this way, it is possible to disable the use of a proxy for specific sockets using the following code:</p>
<pre class="cpp"> serverSocket<span class="operator">-</span><span class="operator">&gt;</span>setProxy(<span class="type">QNetworkProxy</span><span class="operator">::</span>NoProxy);</pre>
<p>Network proxy is not used if the address used in <a href="qabstractsocket.html#connectToHost">connectToHost()</a>, <a href="qudpsocket.html#bind">bind()</a> or <a href="qtcpserver.html#listen">listen()</a> is equivalent to <a href="qhostaddress.html#SpecialAddress-enum">QHostAddress::LocalHost</a> or <a href="qhostaddress.html#SpecialAddress-enum">QHostAddress::LocalHostIPv6</a>.</p>
<p>Each type of proxy support has certain restrictions associated with it. You should read the <a href="qnetworkproxy.html#ProxyType-enum">ProxyType</a> documentation carefully before selecting a proxy type to use.</p>
<p><b>Note:</b> Changes made to currently connected sockets do not take effect. If you need to change a connected socket, you should reconnect it.</p>
<a name="socks5"></a>
<h3>SOCKS5</h3>
<p>The SOCKS5 support in Qt 4 is based on <a href="http://www.rfc-editor.org/rfc/rfc1928.txt">RFC 1928</a> and <a href="http://www.rfc-editor.org/rfc/rfc1929.txt">RFC 1929</a>. The supported authentication methods are no authentication and username/password authentication. Both IPv4 and IPv6 are supported. Domain names are resolved through the SOCKS5 server if the <a href="qnetworkproxy.html#Capability-enum">QNetworkProxy::HostNameLookupCapability</a> is enabled, otherwise they are resolved locally and the IP address is sent to the server. There are several things to remember when using SOCKS5 with <a href="qudpsocket.html">QUdpSocket</a> and <a href="qtcpserver.html">QTcpServer</a>:</p>
<p>With <a href="qudpsocket.html">QUdpSocket</a>, a call to <a href="qudpsocket.html#bind">bind()</a> may fail with a timeout error. If a port number other than 0 is passed to <a href="qudpsocket.html#bind">bind()</a>, it is not guaranteed that it is the specified port that will be used. Use <a href="qabstractsocket.html#localPort">localPort()</a> and <a href="qabstractsocket.html#localAddress">localAddress()</a> to get the actual address and port number in use. Because proxied UDP goes through two UDP connections, it is more likely that packets will be dropped.</p>
<p>With <a href="qtcpserver.html">QTcpServer</a> a call to <a href="qtcpserver.html#listen">listen()</a> may fail with a timeout error. If a port number other than 0 is passed to <a href="qtcpserver.html#listen">listen()</a>, then it is not guaranteed that it is the specified port that will be used. Use <a href="qtcpserver.html#serverPort">serverPort()</a> and <a href="qtcpserver.html#serverAddress">serverAddress()</a> to get the actual address and port used to listen for connections. SOCKS5 only supports one accepted connection per call to <a href="qtcpserver.html#listen">listen()</a>, and each call is likely to result in a different <a href="qtcpserver.html#serverPort">serverPort()</a> being used.</p>
</div>
<p><b>See also </b><a href="qabstractsocket.html">QAbstractSocket</a> and <a href="qtcpserver.html">QTcpServer</a>.</p>
<!-- @@@QNetworkProxy -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$Capability$$$TunnelingCapability$$$ListeningCapability$$$UdpTunnelingCapability$$$CachingCapability$$$HostNameLookupCapability -->
<h3 class="flags"><a name="Capability-enum"></a>enum QNetworkProxy::<span class="name">Capability</span><br/>flags QNetworkProxy::<span class="name">Capabilities</span></h3>
<p>These flags indicate the capabilities that a given proxy server supports.</p>
<p><a href="qnetworkproxy.html">QNetworkProxy</a> sets different capabilities by default when the object is created (see <a href="qnetworkproxy.html#ProxyType-enum">QNetworkProxy::ProxyType</a> for a list of the defaults). However, it is possible to change the capabitilies after the object has been created with <a href="qnetworkproxy.html#setCapabilities">setCapabilities</a>().</p>
<p>The capabilities that <a href="qnetworkproxy.html">QNetworkProxy</a> supports are:</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QNetworkProxy::TunnelingCapability</tt></td><td class="topAlign"><tt>0x0001</tt></td><td class="topAlign">Ability to open transparent, tunneled TCP connections to a remote host. The proxy server relays the transmission verbatim from one side to the other and does no caching.</td></tr>
<tr><td class="topAlign"><tt>QNetworkProxy::ListeningCapability</tt></td><td class="topAlign"><tt>0x0002</tt></td><td class="topAlign">Ability to create a listening socket and wait for an incoming TCP connection from a remote host.</td></tr>
<tr><td class="topAlign"><tt>QNetworkProxy::UdpTunnelingCapability</tt></td><td class="topAlign"><tt>0x0004</tt></td><td class="topAlign">Ability to relay UDP datagrams via the proxy server to and from a remote host.</td></tr>
<tr><td class="topAlign"><tt>QNetworkProxy::CachingCapability</tt></td><td class="topAlign"><tt>0x0008</tt></td><td class="topAlign">Ability to cache the contents of the transfer. This capability is specific to each protocol and proxy type. For example, HTTP proxies can cache the contents of web data transferred with &quot;GET&quot; commands.</td></tr>
<tr><td class="topAlign"><tt>QNetworkProxy::HostNameLookupCapability</tt></td><td class="topAlign"><tt>0x0010</tt></td><td class="topAlign">Ability to connect to perform the lookup on a remote host name and connect to it, as opposed to requiring the application to perform the name lookup and request connection to IP addresses only.</td></tr>
</table>
<p>This enum was introduced or modified in Qt 4.5.</p>
<p>The Capabilities type is a typedef for <a href="qflags.html">QFlags</a>&lt;Capability&gt;. It stores an OR combination of Capability values.</p>
<!-- @@@Capability -->
<!-- $$$ProxyType$$$DefaultProxy$$$Socks5Proxy$$$NoProxy$$$HttpProxy$$$HttpCachingProxy$$$FtpCachingProxy -->
<h3 class="fn"><a name="ProxyType-enum"></a>enum QNetworkProxy::<span class="name">ProxyType</span></h3>
<p>This enum describes the types of network proxying provided in Qt.</p>
<p>There are two types of proxies that Qt understands: transparent proxies and caching proxies. The first group consists of proxies that can handle any arbitrary data transfer, while the second can only handle specific requests. The caching proxies only make sense for the specific classes where they can be used.</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QNetworkProxy::NoProxy</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">No proxying is used</td></tr>
<tr><td class="topAlign"><tt>QNetworkProxy::DefaultProxy</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">Proxy is determined based on the application proxy set using <a href="qnetworkproxy.html#setApplicationProxy">setApplicationProxy</a>()</td></tr>
<tr><td class="topAlign"><tt>QNetworkProxy::Socks5Proxy</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign"><a href="qnetworkproxy.html#socks5">Socks5</a> proxying is used</td></tr>
<tr><td class="topAlign"><tt>QNetworkProxy::HttpProxy</tt></td><td class="topAlign"><tt>3</tt></td><td class="topAlign">HTTP transparent proxying is used (This value was introduced in 4.3&#x2e;)</td></tr>
<tr><td class="topAlign"><tt>QNetworkProxy::HttpCachingProxy</tt></td><td class="topAlign"><tt>4</tt></td><td class="topAlign">Proxying for HTTP requests only (This value was introduced in 4.4&#x2e;)</td></tr>
<tr><td class="topAlign"><tt>QNetworkProxy::FtpCachingProxy</tt></td><td class="topAlign"><tt>5</tt></td><td class="topAlign">Proxying for FTP requests only (This value was introduced in 4.4&#x2e;)</td></tr>
</table>
<p>The table below lists different proxy types and their capabilities. Since each proxy type has different capabilities, it is important to understand them before choosing a proxy type.</p>
<table class="generic">
<thead><tr class="qt-style"><th >Proxy type</th><th >Description</th><th >Default capabilities</th></tr></thead>
<tr valign="top" class="odd"><td >SOCKS 5</td><td >Generic proxy for any kind of connection. Supports TCP, UDP, binding to a port (incoming connections) and authentication.</td><td ><a href="qnetworkproxy.html#Capability-enum">TunnelingCapability</a>, <a href="qnetworkproxy.html#Capability-enum">ListeningCapability</a>, <a href="qnetworkproxy.html#Capability-enum">UdpTunnelingCapability</a>, <a href="qnetworkproxy.html#Capability-enum">HostNameLookupCapability</a></td></tr>
<tr valign="top" class="even"><td >HTTP</td><td >Implemented using the &quot;CONNECT&quot; command, supports only outgoing TCP connections; supports authentication.</td><td ><a href="qnetworkproxy.html#Capability-enum">TunnelingCapability</a>, <a href="qnetworkproxy.html#Capability-enum">CachingCapability</a>, <a href="qnetworkproxy.html#Capability-enum">HostNameLookupCapability</a></td></tr>
<tr valign="top" class="odd"><td >Caching-only HTTP</td><td >Implemented using normal HTTP commands, it is useful only in the context of HTTP requests (see <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a>)</td><td ><a href="qnetworkproxy.html#Capability-enum">CachingCapability</a>, <a href="qnetworkproxy.html#Capability-enum">HostNameLookupCapability</a></td></tr>
<tr valign="top" class="even"><td >Caching FTP</td><td >Implemented using an FTP proxy, it is useful only in the context of FTP requests (see <a href="qftp.html">QFtp</a>, <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a>)</td><td ><a href="qnetworkproxy.html#Capability-enum">CachingCapability</a>, <a href="qnetworkproxy.html#Capability-enum">HostNameLookupCapability</a></td></tr>
</table>
<p>Also note that you shouldn't set the application default proxy (<a href="qnetworkproxy.html#setApplicationProxy">setApplicationProxy</a>()) to a proxy that doesn't have the <a href="qnetworkproxy.html#Capability-enum">TunnelingCapability</a> capability. If you do, <a href="qtcpsocket.html">QTcpSocket</a> will not know how to open connections.</p>
<p><b>See also </b><a href="qnetworkproxy.html#setType">setType</a>(), <a href="qnetworkproxy.html#type">type</a>(), <a href="qnetworkproxy.html#capabilities">capabilities</a>(), and <a href="qnetworkproxy.html#setCapabilities">setCapabilities</a>().</p>
<!-- @@@ProxyType -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QNetworkProxy[overload1]$$$QNetworkProxy -->
<h3 class="fn"><a name="QNetworkProxy"></a>QNetworkProxy::<span class="name">QNetworkProxy</span> ()</h3>
<p>Constructs a <a href="qnetworkproxy.html">QNetworkProxy</a> with <a href="qnetworkproxy.html#ProxyType-enum">DefaultProxy</a> type; the proxy type is determined by <a href="qnetworkproxy.html#applicationProxy">applicationProxy</a>(), which defaults to <a href="qnetworkproxy.html#ProxyType-enum">NoProxy</a>.</p>
<p><b>See also </b><a href="qnetworkproxy.html#setType">setType</a>() and <a href="qnetworkproxy.html#setApplicationProxy">setApplicationProxy</a>().</p>
<!-- @@@QNetworkProxy -->
<!-- $$$QNetworkProxy$$$QNetworkProxyProxyTypeconstQString&quint16constQString&constQString& -->
<h3 class="fn"><a name="QNetworkProxy-2"></a>QNetworkProxy::<span class="name">QNetworkProxy</span> ( <span class="type"><a href="qnetworkproxy.html#ProxyType-enum">ProxyType</a></span> <i>type</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>hostName</i> = QString(), <span class="type"><a href="qtglobal.html#quint16-typedef">quint16</a></span> <i>port</i> = 0, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>user</i> = QString(), const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>password</i> = QString() )</h3>
<p>Constructs a <a href="qnetworkproxy.html">QNetworkProxy</a> with <i>type</i>, <i>hostName</i>, <i>port</i>, <i>user</i> and <i>password</i>.</p>
<p>The default capabilities for proxy type <i>type</i> are set automatically.</p>
<p><b>See also </b><a href="qnetworkproxy.html#capabilities">capabilities</a>().</p>
<!-- @@@QNetworkProxy -->
<!-- $$$QNetworkProxy$$$QNetworkProxyconstQNetworkProxy& -->
<h3 class="fn"><a name="QNetworkProxy-3"></a>QNetworkProxy::<span class="name">QNetworkProxy</span> ( const <span class="type">QNetworkProxy</span> &amp; <i>other</i> )</h3>
<p>Constructs a copy of <i>other</i>.</p>
<!-- @@@QNetworkProxy -->
<!-- $$$~QNetworkProxy[overload1]$$$~QNetworkProxy -->
<h3 class="fn"><a name="dtor.QNetworkProxy"></a>QNetworkProxy::<span class="name">~QNetworkProxy</span> ()</h3>
<p>Destroys the <a href="qnetworkproxy.html">QNetworkProxy</a> object.</p>
<!-- @@@~QNetworkProxy -->
<!-- $$$applicationProxy[overload1]$$$applicationProxy -->
<h3 class="fn"><a name="applicationProxy"></a><span class="type">QNetworkProxy</span> QNetworkProxy::<span class="name">applicationProxy</span> ()<tt> [static]</tt></h3>
<p>Returns the application level network proxying.</p>
<p>If a <a href="qabstractsocket.html">QAbstractSocket</a> or <a href="qtcpsocket.html">QTcpSocket</a> has the <a href="qnetworkproxy.html#ProxyType-enum">QNetworkProxy::DefaultProxy</a> type, then the <a href="qnetworkproxy.html">QNetworkProxy</a> returned by this function is used.</p>
<p><b>See also </b><a href="qnetworkproxyfactory.html">QNetworkProxyFactory</a>, <a href="qnetworkproxy.html#setApplicationProxy">setApplicationProxy</a>(), <a href="qabstractsocket.html#proxy">QAbstractSocket::proxy</a>(), and <a href="qtcpserver.html#proxy">QTcpServer::proxy</a>().</p>
<!-- @@@applicationProxy -->
<!-- $$$capabilities[overload1]$$$capabilities -->
<h3 class="fn"><a name="capabilities"></a><span class="type"><a href="qnetworkproxy.html#Capability-enum">Capabilities</a></span> QNetworkProxy::<span class="name">capabilities</span> () const</h3>
<p>Returns the capabilities of this proxy server.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qnetworkproxy.html#setCapabilities">setCapabilities</a>() and <a href="qnetworkproxy.html#type">type</a>().</p>
<!-- @@@capabilities -->
<!-- $$$hostName[overload1]$$$hostName -->
<h3 class="fn"><a name="hostName"></a><span class="type"><a href="qstring.html">QString</a></span> QNetworkProxy::<span class="name">hostName</span> () const</h3>
<p>Returns the host name of the proxy host.</p>
<p><b>See also </b><a href="qnetworkproxy.html#setHostName">setHostName</a>(), <a href="qnetworkproxy.html#setPort">setPort</a>(), and <a href="qnetworkproxy.html#port">port</a>().</p>
<!-- @@@hostName -->
<!-- $$$isCachingProxy[overload1]$$$isCachingProxy -->
<h3 class="fn"><a name="isCachingProxy"></a><span class="type">bool</span> QNetworkProxy::<span class="name">isCachingProxy</span> () const</h3>
<p>Returns true if this proxy supports the <a href="qnetworkproxy.html#Capability-enum">QNetworkProxy::CachingCapability</a> capability.</p>
<p>In Qt 4.4, the capability was tied to the proxy type, but since Qt 4.5 it is possible to remove the capability of caching from a proxy by calling <a href="qnetworkproxy.html#setCapabilities">setCapabilities</a>().</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qnetworkproxy.html#capabilities">capabilities</a>(), <a href="qnetworkproxy.html#type">type</a>(), and <a href="qnetworkproxy.html#isTransparentProxy">isTransparentProxy</a>().</p>
<!-- @@@isCachingProxy -->
<!-- $$$isTransparentProxy[overload1]$$$isTransparentProxy -->
<h3 class="fn"><a name="isTransparentProxy"></a><span class="type">bool</span> QNetworkProxy::<span class="name">isTransparentProxy</span> () const</h3>
<p>Returns true if this proxy supports transparent tunneling of TCP connections. This matches the <a href="qnetworkproxy.html#Capability-enum">QNetworkProxy::TunnelingCapability</a> capability.</p>
<p>In Qt 4.4, the capability was tied to the proxy type, but since Qt 4.5 it is possible to remove the capability of caching from a proxy by calling <a href="qnetworkproxy.html#setCapabilities">setCapabilities</a>().</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qnetworkproxy.html#capabilities">capabilities</a>(), <a href="qnetworkproxy.html#type">type</a>(), and <a href="qnetworkproxy.html#isCachingProxy">isCachingProxy</a>().</p>
<!-- @@@isTransparentProxy -->
<!-- $$$password[overload1]$$$password -->
<h3 class="fn"><a name="password"></a><span class="type"><a href="qstring.html">QString</a></span> QNetworkProxy::<span class="name">password</span> () const</h3>
<p>Returns the password used for authentication.</p>
<p><b>See also </b><a href="qnetworkproxy.html#user">user</a>(), <a href="qnetworkproxy.html#setPassword">setPassword</a>(), and <a href="qnetworkproxy.html#setUser">setUser</a>().</p>
<!-- @@@password -->
<!-- $$$port[overload1]$$$port -->
<h3 class="fn"><a name="port"></a><span class="type"><a href="qtglobal.html#quint16-typedef">quint16</a></span> QNetworkProxy::<span class="name">port</span> () const</h3>
<p>Returns the port of the proxy host.</p>
<p><b>See also </b><a href="qnetworkproxy.html#setHostName">setHostName</a>(), <a href="qnetworkproxy.html#setPort">setPort</a>(), and <a href="qnetworkproxy.html#hostName">hostName</a>().</p>
<!-- @@@port -->
<!-- $$$setApplicationProxy[overload1]$$$setApplicationProxyconstQNetworkProxy& -->
<h3 class="fn"><a name="setApplicationProxy"></a><span class="type">void</span> QNetworkProxy::<span class="name">setApplicationProxy</span> ( const <span class="type">QNetworkProxy</span> &amp; <i>networkProxy</i> )<tt> [static]</tt></h3>
<p>Sets the application level network proxying to be <i>networkProxy</i>.</p>
<p>If a <a href="qabstractsocket.html">QAbstractSocket</a> or <a href="qtcpsocket.html">QTcpSocket</a> has the <a href="qnetworkproxy.html#ProxyType-enum">QNetworkProxy::DefaultProxy</a> type, then the <a href="qnetworkproxy.html">QNetworkProxy</a> set with this function is used. If you want more flexibility in determining which the proxy, use the <a href="qnetworkproxyfactory.html">QNetworkProxyFactory</a> class.</p>
<p>Setting a default proxy value with this function will override the application proxy factory set with QNetworkProxyFactory::setApplicationProxyFactory.</p>
<p><b>See also </b><a href="qnetworkproxyfactory.html">QNetworkProxyFactory</a>, <a href="qnetworkproxy.html#applicationProxy">applicationProxy</a>(), <a href="qabstractsocket.html#setProxy">QAbstractSocket::setProxy</a>(), and <a href="qtcpserver.html#setProxy">QTcpServer::setProxy</a>().</p>
<!-- @@@setApplicationProxy -->
<!-- $$$setCapabilities[overload1]$$$setCapabilitiesCapabilities -->
<h3 class="fn"><a name="setCapabilities"></a><span class="type">void</span> QNetworkProxy::<span class="name">setCapabilities</span> ( <span class="type"><a href="qnetworkproxy.html#Capability-enum">Capabilities</a></span> <i>capabilities</i> )</h3>
<p>Sets the capabilities of this proxy to <i>capabilities</i>.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qnetworkproxy.html#setType">setType</a>() and <a href="qnetworkproxy.html#capabilities">capabilities</a>().</p>
<!-- @@@setCapabilities -->
<!-- $$$setHostName[overload1]$$$setHostNameconstQString& -->
<h3 class="fn"><a name="setHostName"></a><span class="type">void</span> QNetworkProxy::<span class="name">setHostName</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>hostName</i> )</h3>
<p>Sets the host name of the proxy host to be <i>hostName</i>.</p>
<p><b>See also </b><a href="qnetworkproxy.html#hostName">hostName</a>(), <a href="qnetworkproxy.html#setPort">setPort</a>(), and <a href="qnetworkproxy.html#port">port</a>().</p>
<!-- @@@setHostName -->
<!-- $$$setPassword[overload1]$$$setPasswordconstQString& -->
<h3 class="fn"><a name="setPassword"></a><span class="type">void</span> QNetworkProxy::<span class="name">setPassword</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>password</i> )</h3>
<p>Sets the password for proxy authentication to be <i>password</i>.</p>
<p><b>See also </b><a href="qnetworkproxy.html#user">user</a>(), <a href="qnetworkproxy.html#setUser">setUser</a>(), and <a href="qnetworkproxy.html#password">password</a>().</p>
<!-- @@@setPassword -->
<!-- $$$setPort[overload1]$$$setPortquint16 -->
<h3 class="fn"><a name="setPort"></a><span class="type">void</span> QNetworkProxy::<span class="name">setPort</span> ( <span class="type"><a href="qtglobal.html#quint16-typedef">quint16</a></span> <i>port</i> )</h3>
<p>Sets the port of the proxy host to be <i>port</i>.</p>
<p><b>See also </b><a href="qnetworkproxy.html#hostName">hostName</a>(), <a href="qnetworkproxy.html#setHostName">setHostName</a>(), and <a href="qnetworkproxy.html#port">port</a>().</p>
<!-- @@@setPort -->
<!-- $$$setType[overload1]$$$setTypeQNetworkProxy::ProxyType -->
<h3 class="fn"><a name="setType"></a><span class="type">void</span> QNetworkProxy::<span class="name">setType</span> ( <span class="type"><a href="qnetworkproxy.html#ProxyType-enum">QNetworkProxy::ProxyType</a></span> <i>type</i> )</h3>
<p>Sets the proxy type for this instance to be <i>type</i>.</p>
<p>Note that changing the type of a proxy does not change the set of capabilities this <a href="qnetworkproxy.html">QNetworkProxy</a> object holds if any capabilities have been set with <a href="qnetworkproxy.html#setCapabilities">setCapabilities</a>().</p>
<p><b>See also </b><a href="qnetworkproxy.html#type">type</a>() and <a href="qnetworkproxy.html#setCapabilities">setCapabilities</a>().</p>
<!-- @@@setType -->
<!-- $$$setUser[overload1]$$$setUserconstQString& -->
<h3 class="fn"><a name="setUser"></a><span class="type">void</span> QNetworkProxy::<span class="name">setUser</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>user</i> )</h3>
<p>Sets the user name for proxy authentication to be <i>user</i>.</p>
<p><b>See also </b><a href="qnetworkproxy.html#user">user</a>(), <a href="qnetworkproxy.html#setPassword">setPassword</a>(), and <a href="qnetworkproxy.html#password">password</a>().</p>
<!-- @@@setUser -->
<!-- $$$type[overload1]$$$type -->
<h3 class="fn"><a name="type"></a><span class="type"><a href="qnetworkproxy.html#ProxyType-enum">QNetworkProxy::ProxyType</a></span> QNetworkProxy::<span class="name">type</span> () const</h3>
<p>Returns the proxy type for this instance.</p>
<p><b>See also </b><a href="qnetworkproxy.html#setType">setType</a>().</p>
<!-- @@@type -->
<!-- $$$user[overload1]$$$user -->
<h3 class="fn"><a name="user"></a><span class="type"><a href="qstring.html">QString</a></span> QNetworkProxy::<span class="name">user</span> () const</h3>
<p>Returns the user name used for authentication.</p>
<p><b>See also </b><a href="qnetworkproxy.html#setUser">setUser</a>(), <a href="qnetworkproxy.html#setPassword">setPassword</a>(), and <a href="qnetworkproxy.html#password">password</a>().</p>
<!-- @@@user -->
<!-- $$$operator!=[overload1]$$$operator!=constQNetworkProxy& -->
<h3 class="fn"><a name="operator-not-eq"></a><span class="type">bool</span> QNetworkProxy::<span class="name">operator!=</span> ( const <span class="type">QNetworkProxy</span> &amp; <i>other</i> ) const</h3>
<p>Compares the value of this network proxy to <i>other</i> and returns true if they differ.</p>
<p>This function was introduced in Qt 4.4.</p>
<!-- @@@operator!= -->
<!-- $$$operator=[overload1]$$$operator=constQNetworkProxy& -->
<h3 class="fn"><a name="operator-eq"></a><span class="type">QNetworkProxy</span> &amp; QNetworkProxy::<span class="name">operator=</span> ( const <span class="type">QNetworkProxy</span> &amp; <i>other</i> )</h3>
<p>Assigns the value of the network proxy <i>other</i> to this network proxy.</p>
<p>This function was introduced in Qt 4.2.</p>
<!-- @@@operator= -->
<!-- $$$operator==[overload1]$$$operator==constQNetworkProxy& -->
<h3 class="fn"><a name="operator-eq-eq"></a><span class="type">bool</span> QNetworkProxy::<span class="name">operator==</span> ( const <span class="type">QNetworkProxy</span> &amp; <i>other</i> ) const</h3>
<p>Compares the value of this network proxy to <i>other</i> and returns true if they are equal (same proxy type, server as well as username and password)</p>
<p>This function was introduced in Qt 4.4.</p>
<!-- @@@operator== -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2015 The Qt Company Ltd.
      Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Qt and respective logos are trademarks of The Qt Company Ltd 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>