Sophie

Sophie

distrib > Mageia > 4 > i586 > by-pkgid > 28b9e36e96ce34b2567ae5b47a27b2c5 > files > 892

python-qt4-doc-4.10.3-3.mga4.noarch.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QNetworkProxy Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QNetworkProxy Class Reference<br /><sup><sup>[<a href="qtnetwork.html">QtNetwork</a> module]</sup></sup></h1><p>The QNetworkProxy class provides a network layer proxy. <a href="#details">More...</a></p>

<h3>Types</h3><ul><li><div class="fn" />class <b><a href="qnetworkproxy-capabilities.html">Capabilities</a></b></li><li><div class="fn" />enum <b><a href="qnetworkproxy.html#Capability-enum">Capability</a></b> { TunnelingCapability, ListeningCapability, UdpTunnelingCapability, CachingCapability, HostNameLookupCapability }</li><li><div class="fn" />enum <b><a href="qnetworkproxy.html#ProxyType-enum">ProxyType</a></b> { DefaultProxy, Socks5Proxy, NoProxy, HttpProxy, HttpCachingProxy, FtpCachingProxy }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qnetworkproxy.html#QNetworkProxy">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qnetworkproxy.html#QNetworkProxy-2">__init__</a></b> (<i>self</i>, ProxyType&#160;<i>type</i>, QString&#160;<i>hostName</i>&#160;=&#160;QString(), int&#160;<i>port</i>&#160;=&#160;0, QString&#160;<i>user</i>&#160;=&#160;QString(), QString&#160;<i>password</i>&#160;=&#160;QString())</li><li><div class="fn" /><b><a href="qnetworkproxy.html#QNetworkProxy-3">__init__</a></b> (<i>self</i>, QNetworkProxy&#160;<i>other</i>)</li><li><div class="fn" />Capabilities <b><a href="qnetworkproxy.html#capabilities">capabilities</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qnetworkproxy.html#hostName">hostName</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qnetworkproxy.html#isCachingProxy">isCachingProxy</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qnetworkproxy.html#isTransparentProxy">isTransparentProxy</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qnetworkproxy.html#password">password</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qnetworkproxy.html#port">port</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qnetworkproxy.html#setCapabilities">setCapabilities</a></b> (<i>self</i>, Capabilities&#160;<i>capab</i>)</li><li><div class="fn" /><b><a href="qnetworkproxy.html#setHostName">setHostName</a></b> (<i>self</i>, QString&#160;<i>hostName</i>)</li><li><div class="fn" /><b><a href="qnetworkproxy.html#setPassword">setPassword</a></b> (<i>self</i>, QString&#160;<i>password</i>)</li><li><div class="fn" /><b><a href="qnetworkproxy.html#setPort">setPort</a></b> (<i>self</i>, int&#160;<i>port</i>)</li><li><div class="fn" /><b><a href="qnetworkproxy.html#setType">setType</a></b> (<i>self</i>, ProxyType&#160;<i>type</i>)</li><li><div class="fn" /><b><a href="qnetworkproxy.html#setUser">setUser</a></b> (<i>self</i>, QString&#160;<i>userName</i>)</li><li><div class="fn" />ProxyType <b><a href="qnetworkproxy.html#type">type</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qnetworkproxy.html#user">user</a></b> (<i>self</i>)</li></ul><h3>Static Methods</h3><ul><li><div class="fn" />QNetworkProxy <b><a href="qnetworkproxy.html#applicationProxy">applicationProxy</a></b> ()</li><li><div class="fn" /><b><a href="qnetworkproxy.html#setApplicationProxy">setApplicationProxy</a></b> (QNetworkProxy&#160;<i>proxy</i>)</li></ul><h3>Special Methods</h3><ul><li><div class="fn" />bool <b><a href="qnetworkproxy.html#__eq__">__eq__</a></b> (<i>self</i>, QNetworkProxy&#160;<i>other</i>)</li><li><div class="fn" />bool <b><a href="qnetworkproxy.html#__ne__">__ne__</a></b> (<i>self</i>, QNetworkProxy&#160;<i>other</i>)</li></ul><a name="details" /><hr /><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">"proxy.example.com"</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">"username"</span>);
 proxy<span class="operator">.</span><a href="qnetworkproxy.html#setPassword">setPassword</a>(<span class="string">"password"</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 id="socks5" name="socks5" />
<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>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="Capability-enum" />QNetworkProxy.Capability</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 class="odd" valign="top">
<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 "GET" 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>


<h3 class="fn"><a name="ProxyType-enum" />QNetworkProxy.ProxyType</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 class="odd" valign="top">
<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.)</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.)</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.)</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 class="odd" valign="top">
<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 class="even" valign="top">
<td>HTTP</td>
<td>Implemented using the "CONNECT" 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 class="odd" valign="top">
<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 class="even" valign="top">
<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>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QNetworkProxy" />QNetworkProxy.__init__ (<i>self</i>)</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>


<h3 class="fn"><a name="QNetworkProxy-2" />QNetworkProxy.__init__ (<i>self</i>, <a href="qnetworkproxy.html#ProxyType-enum">ProxyType</a>&#160;<i>type</i>, QString&#160;<i>hostName</i>&#160;=&#160;QString(), int&#160;<i>port</i>&#160;=&#160;0, QString&#160;<i>user</i>&#160;=&#160;QString(), QString&#160;<i>password</i>&#160;=&#160;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>


<h3 class="fn"><a name="QNetworkProxy-3" />QNetworkProxy.__init__ (<i>self</i>, <a href="qnetworkproxy.html">QNetworkProxy</a>&#160;<i>other</i>)</h3><p>Constructs a copy of <i>other</i>.</p>


<h3 class="fn"><a name="applicationProxy" /><a href="qnetworkproxy.html">QNetworkProxy</a> QNetworkProxy.applicationProxy ()</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>


<h3 class="fn"><a name="capabilities" /><a href="qnetworkproxy-capabilities.html">Capabilities</a> QNetworkProxy.capabilities (<i>self</i>)</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>


<h3 class="fn"><a name="hostName" />QString QNetworkProxy.hostName (<i>self</i>)</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>


<h3 class="fn"><a name="isCachingProxy" />bool QNetworkProxy.isCachingProxy (<i>self</i>)</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>


<h3 class="fn"><a name="isTransparentProxy" />bool QNetworkProxy.isTransparentProxy (<i>self</i>)</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>


<h3 class="fn"><a name="password" />QString QNetworkProxy.password (<i>self</i>)</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>


<h3 class="fn"><a name="port" />int QNetworkProxy.port (<i>self</i>)</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>


<h3 class="fn"><a name="setApplicationProxy" />QNetworkProxy.setApplicationProxy (<a href="qnetworkproxy.html">QNetworkProxy</a>&#160;<i>proxy</i>)</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>


<h3 class="fn"><a name="setCapabilities" />QNetworkProxy.setCapabilities (<i>self</i>, <a href="qnetworkproxy-capabilities.html">Capabilities</a>&#160;<i>capab</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>


<h3 class="fn"><a name="setHostName" />QNetworkProxy.setHostName (<i>self</i>, QString&#160;<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>


<h3 class="fn"><a name="setPassword" />QNetworkProxy.setPassword (<i>self</i>, QString&#160;<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>


<h3 class="fn"><a name="setPort" />QNetworkProxy.setPort (<i>self</i>, int&#160;<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>


<h3 class="fn"><a name="setType" />QNetworkProxy.setType (<i>self</i>, <a href="qnetworkproxy.html#ProxyType-enum">ProxyType</a>&#160;<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>


<h3 class="fn"><a name="setUser" />QNetworkProxy.setUser (<i>self</i>, QString&#160;<i>userName</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>


<h3 class="fn"><a name="type" /><a href="qnetworkproxy.html#ProxyType-enum">ProxyType</a> QNetworkProxy.type (<i>self</i>)</h3><p>Returns the proxy type for this instance.</p>
<p><b>See also</b> <a href="qnetworkproxy.html#setType">setType</a>().</p>


<h3 class="fn"><a name="user" />QString QNetworkProxy.user (<i>self</i>)</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>


<h3 class="fn"><a name="__eq__" />bool QNetworkProxy.__eq__ (<i>self</i>, <a href="qnetworkproxy.html">QNetworkProxy</a>&#160;<i>other</i>)</h3><h3 class="fn"><a name="__ne__" />bool QNetworkProxy.__ne__ (<i>self</i>, <a href="qnetworkproxy.html">QNetworkProxy</a>&#160;<i>other</i>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.10.3 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt&#160;4.8.5</td></tr></table></div></address></body></html>