1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349
|
<?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">  </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <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 <i>type</i>, QString <i>hostName</i> = QString(), int <i>port</i> = 0, QString <i>user</i> = QString(), QString <i>password</i> = QString())</li><li><div class="fn" /><b><a href="qnetworkproxy.html#QNetworkProxy-3">__init__</a></b> (<i>self</i>, QNetworkProxy <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 <i>capab</i>)</li><li><div class="fn" /><b><a href="qnetworkproxy.html#setHostName">setHostName</a></b> (<i>self</i>, QString <i>hostName</i>)</li><li><div class="fn" /><b><a href="qnetworkproxy.html#setPassword">setPassword</a></b> (<i>self</i>, QString <i>password</i>)</li><li><div class="fn" /><b><a href="qnetworkproxy.html#setPort">setPort</a></b> (<i>self</i>, int <i>port</i>)</li><li><div class="fn" /><b><a href="qnetworkproxy.html#setType">setType</a></b> (<i>self</i>, ProxyType <i>type</i>)</li><li><div class="fn" /><b><a href="qnetworkproxy.html#setUser">setUser</a></b> (<i>self</i>, QString <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 <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 <i>other</i>)</li><li><div class="fn" />bool <b><a href="qnetworkproxy.html#__ne__">__ne__</a></b> (<i>self</i>, QNetworkProxy <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">></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><Capability>. 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> <i>type</i>, QString <i>hostName</i> = QString(), int <i>port</i> = 0, QString <i>user</i> = QString(), QString <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>
<h3 class="fn"><a name="QNetworkProxy-3" />QNetworkProxy.__init__ (<i>self</i>, <a href="qnetworkproxy.html">QNetworkProxy</a> <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> <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> <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 <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 <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 <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> <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 <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> <i>other</i>)</h3><h3 class="fn"><a name="__ne__" />bool QNetworkProxy.__ne__ (<i>self</i>, <a href="qnetworkproxy.html">QNetworkProxy</a> <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 4.9.3 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt 4.8.2</td></tr></table></div></address></body></html>
|