<class name="QNetworkProxy" doc="/**
&lt;p&gt;The &lt;a href=&quot;QNetworkProxy.html#QNetworkProxy(com.trolltech.qt.network.QNetworkProxy)&quot;&gt;&lt;tt&gt;QNetworkProxy&lt;/tt&gt;&lt;/a&gt; class provides a network layer proxy.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;QNetworkProxy.html#QNetworkProxy(com.trolltech.qt.network.QNetworkProxy)&quot;&gt;&lt;tt&gt;QNetworkProxy&lt;/tt&gt;&lt;/a&gt; provides the method for configuring network layer proxy support to the Qt network classes. The currently supported classes are &lt;a href=&quot;QAbstractSocket.html&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QTcpSocket.html&quot;&gt;&lt;tt&gt;QTcpSocket&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QUdpSocket.html&quot;&gt;&lt;tt&gt;QUdpSocket&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QTcpServer.html&quot;&gt;&lt;tt&gt;QTcpServer&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html&quot;&gt;&lt;tt&gt;QHttp&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QFtp.html&quot;&gt;&lt;tt&gt;QFtp&lt;/tt&gt;&lt;/a&gt;. 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.&lt;/p&gt;
&lt;pre&gt;    QNetworkProxy proxy;
    proxy.setType(QNetworkProxy::Socks5Proxy);
    proxy.setHostName(&amp;quot;proxy.example.com&amp;quot;);
    proxy.setPort(1080);
    proxy.setUser(&amp;quot;username&amp;quot;);
    proxy.setPassword(&amp;quot;password&amp;quot;);
    QNetworkProxy::setApplicationProxy(proxy);&lt;/pre&gt;
&lt;p&gt;An alternative to setting an application wide proxy is to specify the proxy for individual sockets using QAbstractSocket::setProxy() and QTcpServer::setProxy(). In this way, it is possible to disable the use of a proxy for specific sockets using the following code:&lt;/p&gt;
&lt;pre&gt;    serverSocket-&amp;gt;setProxy(QNetworkProxy::NoProxy);&lt;/pre&gt;
&lt;p&gt;Network proxy is not used if the address used in connectToHost(), bind() or listen() is equivalent to QHostAddress::LocalHost or QHostAddress::LocalHostIPv6.&lt;/p&gt;
&lt;p&gt;Each type of proxy support has certain restrictions associated with it. You should read the &lt;a href=&quot;QNetworkProxy.html#ProxyType-enum&quot;&gt;&lt;tt&gt;ProxyType&lt;/tt&gt;&lt;/a&gt; documentation carefully before selecting a proxy type to use.&lt;/p&gt;
&lt;a name=&quot;socks5&quot;&gt;&lt;/a&gt;
&lt;h3&gt;SOCKS5&lt;/h3&gt;
&lt;p&gt;The SOCKS5 support in Qt 4 is based on RFC 1928&lt;/tt&gt; and RFC 1929&lt;/tt&gt;. The supported authentication methods are no authentication and username/password authentication. Both IPv4 and IPv6 are supported, but domain name resolution via the SOCKS server is not supported; i.e&amp;#x2e; all domain names are resolved locally. There are several things to remember when using SOCKS5 with &lt;a href=&quot;QUdpSocket.html&quot;&gt;&lt;tt&gt;QUdpSocket&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QTcpServer.html&quot;&gt;&lt;tt&gt;QTcpServer&lt;/tt&gt;&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;With &lt;a href=&quot;QUdpSocket.html&quot;&gt;&lt;tt&gt;QUdpSocket&lt;/tt&gt;&lt;/a&gt;, a call to bind() may fail with a timeout error. If a port number other than 0 is passed to bind(), it is not guaranteed that it is the specified port that will be used. Use localPort() and localAddress() 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.&lt;/p&gt;
&lt;p&gt;With &lt;a href=&quot;QTcpServer.html&quot;&gt;&lt;tt&gt;QTcpServer&lt;/tt&gt;&lt;/a&gt; a call to listen() may fail with a timeout error. If a port number other than 0 is passed to listen(), then it is not guaranteed that it is the specified port that will be used. Use serverPort() and serverAddress() to get the actual address and port used to listen for connections. SOCKS5 only supports one accepted connection per call to listen(), and each call is likely to result in a different serverPort() being used.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractSocket.html&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QTcpServer.html&quot;&gt;&lt;tt&gt;QTcpServer&lt;/tt&gt;&lt;/a&gt; */">
    <method name="public QNetworkProxy()" doc="/**
&lt;p&gt;Constructs a &lt;a href=&quot;QNetworkProxy.html#QNetworkProxy(com.trolltech.qt.network.QNetworkProxy)&quot;&gt;&lt;tt&gt;QNetworkProxy&lt;/tt&gt;&lt;/a&gt; with &lt;a href=&quot;QNetworkProxy.html#ProxyType-enum&quot;&gt;&lt;tt&gt;DefaultProxy&lt;/tt&gt;&lt;/a&gt; type; the proxy type is determined by &lt;a href=&quot;QNetworkProxy.html#applicationProxy()&quot;&gt;&lt;tt&gt;applicationProxy&lt;/tt&gt;&lt;/a&gt;, which defaults to &lt;a href=&quot;QNetworkProxy.html#ProxyType-enum&quot;&gt;&lt;tt&gt;NoProxy&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QNetworkProxy.html#setType(com.trolltech.qt.network.QNetworkProxy.ProxyType)&quot;&gt;&lt;tt&gt;setType&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QNetworkProxy.html#setApplicationProxy(com.trolltech.qt.network.QNetworkProxy)&quot;&gt;&lt;tt&gt;setApplicationProxy&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public QNetworkProxy(com.trolltech.qt.network.QNetworkProxy other)" doc="/**
&lt;p&gt;Constructs a copy of &lt;tt&gt;other&lt;/tt&gt;.&lt;/p&gt;
 */"/>
    <method name="public final java.lang.String hostName()" doc="/**
&lt;p&gt;Returns the host name of the proxy host.&lt;/p&gt;

@see &lt;a href=&quot;QNetworkProxy.html#setHostName(java.lang.String)&quot;&gt;&lt;tt&gt;setHostName&lt;/tt&gt;&lt;/a&gt;
@see &lt;tt&gt;setPort&lt;/tt&gt;
@see &lt;tt&gt;port&lt;/tt&gt; */"/>
    <method name="public final java.lang.String password()" doc="/**
&lt;p&gt;Returns the password used for authentication.&lt;/p&gt;

@see &lt;a href=&quot;QNetworkProxy.html#user()&quot;&gt;&lt;tt&gt;user&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QNetworkProxy.html#setPassword(java.lang.String)&quot;&gt;&lt;tt&gt;setPassword&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QNetworkProxy.html#setUser(java.lang.String)&quot;&gt;&lt;tt&gt;setUser&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void setHostName(java.lang.String hostName)" doc="/**
&lt;p&gt;Sets the host name of the proxy host to be &lt;tt&gt;hostName&lt;/tt&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QNetworkProxy.html#hostName()&quot;&gt;&lt;tt&gt;hostName&lt;/tt&gt;&lt;/a&gt;
@see &lt;tt&gt;setPort&lt;/tt&gt;
@see &lt;tt&gt;port&lt;/tt&gt; */"/>
    <method name="public final void setPassword(java.lang.String password)" doc="/**
&lt;p&gt;Sets the password for proxy authentication to be &lt;tt&gt;password&lt;/tt&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QNetworkProxy.html#user()&quot;&gt;&lt;tt&gt;user&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QNetworkProxy.html#setUser(java.lang.String)&quot;&gt;&lt;tt&gt;setUser&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QNetworkProxy.html#password()&quot;&gt;&lt;tt&gt;password&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void setType(com.trolltech.qt.network.QNetworkProxy.ProxyType type)" doc="/**
&lt;p&gt;Sets the proxy type for this instance to be &lt;tt&gt;type&lt;/tt&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QNetworkProxy.html#type()&quot;&gt;&lt;tt&gt;type&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void setUser(java.lang.String userName)" doc="/**
&lt;p&gt;Sets the user name for proxy authentication to be &lt;tt&gt;userName&lt;/tt&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QNetworkProxy.html#user()&quot;&gt;&lt;tt&gt;user&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QNetworkProxy.html#setPassword(java.lang.String)&quot;&gt;&lt;tt&gt;setPassword&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QNetworkProxy.html#password()&quot;&gt;&lt;tt&gt;password&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.network.QNetworkProxy.ProxyType type()" doc="/**
&lt;p&gt;Returns the proxy type for this instance.&lt;/p&gt;

@see &lt;a href=&quot;QNetworkProxy.html#setType(com.trolltech.qt.network.QNetworkProxy.ProxyType)&quot;&gt;&lt;tt&gt;setType&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final java.lang.String user()" doc="/**
&lt;p&gt;Returns the user name used for authentication.&lt;/p&gt;

@see &lt;a href=&quot;QNetworkProxy.html#setUser(java.lang.String)&quot;&gt;&lt;tt&gt;setUser&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QNetworkProxy.html#setPassword(java.lang.String)&quot;&gt;&lt;tt&gt;setPassword&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QNetworkProxy.html#password()&quot;&gt;&lt;tt&gt;password&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public native static com.trolltech.qt.network.QNetworkProxy applicationProxy()" doc="/**
&lt;p&gt;Returns the application level network proxying.&lt;/p&gt;
&lt;p&gt;If a &lt;a href=&quot;QAbstractSocket.html&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt; or &lt;a href=&quot;QTcpSocket.html&quot;&gt;&lt;tt&gt;QTcpSocket&lt;/tt&gt;&lt;/a&gt; has the QNetworkProxy::DefaultProxy type, then the &lt;a href=&quot;QNetworkProxy.html#QNetworkProxy(com.trolltech.qt.network.QNetworkProxy)&quot;&gt;&lt;tt&gt;QNetworkProxy&lt;/tt&gt;&lt;/a&gt; returned by this function is used.&lt;/p&gt;

@see &lt;a href=&quot;QNetworkProxy.html#setApplicationProxy(com.trolltech.qt.network.QNetworkProxy)&quot;&gt;&lt;tt&gt;setApplicationProxy&lt;/tt&gt;&lt;/a&gt;
@see &lt;tt&gt;QAbstractSocket::proxy&lt;/tt&gt;
@see &lt;tt&gt;QTcpServer::proxy&lt;/tt&gt; */"/>
    <method name="public static void setApplicationProxy(com.trolltech.qt.network.QNetworkProxy proxy)" doc="/**
&lt;p&gt;Sets the application level network proxying to be &lt;tt&gt;proxy&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;If a &lt;a href=&quot;QAbstractSocket.html&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt; or &lt;a href=&quot;QTcpSocket.html&quot;&gt;&lt;tt&gt;QTcpSocket&lt;/tt&gt;&lt;/a&gt; has the QNetworkProxy::DefaultProxy type, then the &lt;a href=&quot;QNetworkProxy.html#QNetworkProxy(com.trolltech.qt.network.QNetworkProxy)&quot;&gt;&lt;tt&gt;QNetworkProxy&lt;/tt&gt;&lt;/a&gt; set with this function is used.&lt;/p&gt;

@see &lt;a href=&quot;QNetworkProxy.html#applicationProxy()&quot;&gt;&lt;tt&gt;applicationProxy&lt;/tt&gt;&lt;/a&gt;
@see &lt;tt&gt;QAbstractSocket::setProxy&lt;/tt&gt;
@see &lt;tt&gt;QTcpServer::setProxy&lt;/tt&gt; */"/>
    <enum name="ProxyType" doc="/**
&lt;p&gt;This enum describes the types of network proxying provided in Qt.&lt;/p&gt;
&lt;p&gt;While Socks5 proxying works for both Tcp and Udp sockets, Http proxying is limited to Tcp connections. Http proxying also doesn't support binding sockets.&lt;/p&gt;

@see &lt;a href=&quot;QNetworkProxy.html#setType(com.trolltech.qt.network.QNetworkProxy.ProxyType)&quot;&gt;&lt;tt&gt;setType&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QNetworkProxy.html#type()&quot;&gt;&lt;tt&gt;type&lt;/tt&gt;&lt;/a&gt; */">
        <enum-value name="DefaultProxy" doc="/**
&lt;p&gt;Proxy is determined based on the application proxy set using &lt;a href=&quot;QNetworkProxy.html#setApplicationProxy(com.trolltech.qt.network.QNetworkProxy)&quot;&gt;&lt;tt&gt;setApplicationProxy&lt;/tt&gt;&lt;/a&gt;&lt;/p&gt;
 */"/>
        <enum-value name="Socks5Proxy" doc="/**
&lt;p&gt;&lt;a href=&quot;QNetworkProxy.html#socks5&quot;&gt;&lt;tt&gt;Socks5&lt;/tt&gt;&lt;/a&gt; proxying is used&lt;/p&gt;
 */"/>
        <enum-value name="NoProxy" doc="/**
&lt;p&gt;No proxying is used&lt;/p&gt;
 */"/>
        <enum-value name="HttpProxy" doc="/**
&lt;p&gt;Http proxying is used&lt;/p&gt;
 */"/>
</enum>
</class>
