Logo Search packages:      
Sourcecode: qt4-x11 version File versions

QNetworkProxy Class Reference

List of all members.

Detailed Description

The QNetworkProxy class provides a network layer proxy.



QNetworkProxy provides the method for configuring network layer proxy support to the Qt network classes. The currently supported classes are QAbstractSocket, QTcpSocket, QUdpSocket, QTcpServer, QHttp and QFtp. 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.

doc/src/snippets/code/src_network_kernel_qnetworkproxy.cpp 0

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:

doc/src/snippets/code/src_network_kernel_qnetworkproxy.cpp 1

Network proxy is not used if the address used in {QAbstractSocket::connectToHost()}{connectToHost()}, {QUdpSocket::bind()}{bind()} or {QTcpServer::listen()}{listen()} is equivalent to QHostAddress::LocalHost or QHostAddress::LocalHostIPv6.

Each type of proxy support has certain restrictions associated with it. You should read the {ProxyType} documentation carefully before selecting a proxy type to use.

Changes made to currently connected sockets do not take effect. If you need to change a connected socket, you should reconnect it.

Definition at line 102 of file qnetworkproxy.h.

Public Types

enum  Capability {
  TunnelingCapability = 0x0001, ListeningCapability = 0x0002, UdpTunnelingCapability = 0x0004, CachingCapability = 0x0008,
  HostNameLookupCapability = 0x0010
enum  ProxyType {
  DefaultProxy, Socks5Proxy, NoProxy, HttpProxy,
  HttpCachingProxy, FtpCachingProxy

Public Member Functions

Capabilities capabilities () const
QString hostName () const
bool isCachingProxy () const
bool isTransparentProxy () const
bool operator!= (const QNetworkProxy &other) const
QNetworkProxyoperator= (const QNetworkProxy &other)
bool operator== (const QNetworkProxy &other) const
QString password () const
quint16 port () const
 QNetworkProxy (const QNetworkProxy &other)
 QNetworkProxy (ProxyType type, const QString &hostName=QString(), quint16 port=0, const QString &user=QString(), const QString &password=QString())
 QNetworkProxy ()
void setCapabilities (Capabilities capab)
void setHostName (const QString &hostName)
void setPassword (const QString &password)
void setPort (quint16 port)
void setType (QNetworkProxy::ProxyType type)
void setUser (const QString &userName)
QNetworkProxy::ProxyType type () const
QString user () const
 ~QNetworkProxy ()

Static Public Member Functions

static QNetworkProxy applicationProxy ()
static void setApplicationProxy (const QNetworkProxy &proxy)

Private Attributes

< QNetworkProxyPrivate > 

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index