PythonQt.QtNetwork.QNetworkProxyFactory · declarations 001
Back to PythonQt.QtNetwork.QNetworkProxyFactory
proxyForQuery
proxyForQuery(query: Any) -> tuple
X.proxyForQuery(query) -> tuple
Supplemental documentation: Qt 5 reference:
[static] QList\<QNetworkProxy> QNetworkProxyFactory::proxyForQuery(const QNetworkProxyQuery \&query)
This function takes the query request, query, examines the details of the type of socket or request and returns a list of QNetworkProxy objects that indicate the proxy servers to be used, in order of preference.
Upstream PySide2 reference signatures (binding differences may apply):
proxyForQuery(query: PySide2.QtNetwork.QNetworkProxyQuery) -> typing.List[PySide2.QtNetwork.QNetworkProxy]
Source: https://doc.qt.io/archives/qt-5.15/qnetworkproxyfactory.html#proxyForQuery
queryProxy
queryProxy(query: Any) -> tuple
X.queryProxy(query) -> tuple
Supplemental documentation: Qt 5 reference:
[pure virtual] QList\<QNetworkProxy> QNetworkProxyFactory::queryProxy(const QNetworkProxyQuery \&query \= QNetworkProxyQuery())
This function takes the query request, query, examines the details of the type of socket or request and returns a list of QNetworkProxy objects that indicate the proxy servers to be used, in order of preference.
When reimplementing this class, take care to return at least one element.
If you cannot determine a better proxy alternative, use QNetworkProxy::DefaultProxy, which tells the code querying for a proxy to use a higher alternative. For example, if this factory is set to a QNetworkAccessManager object, DefaultProxy will tell it to query the application-level proxy settings.
If this factory is set as the application proxy factory, DefaultProxy and NoProxy will have the same meaning.
Upstream PySide2 reference signatures (binding differences may apply):
queryProxy(self, query: PySide2.QtNetwork.QNetworkProxyQuery=...) -> typing.List[PySide2.QtNetwork.QNetworkProxy]
Source: https://doc.qt.io/archives/qt-5.15/qnetworkproxyfactory.html#queryProxy
setApplicationProxyFactory
setApplicationProxyFactory(factory: Any) -> None
X.setApplicationProxyFactory(factory)
Supplemental documentation: Qt 5 reference:
[static] void QNetworkProxyFactory::setApplicationProxyFactory(QNetworkProxyFactory *factory)
Sets the application-wide proxy factory to be factory. This function will take ownership of that object and will delete it when necessary.
The application-wide proxy is used as a last-resort when all other proxy selection requests returned QNetworkProxy::DefaultProxy. For example, QTcpSocket objects can have a proxy set with QTcpSocket::setProxy, but if none is set, the proxy factory class set with this function will be queried.
If you set a proxy factory with this function, any application level proxies set with
QNetworkProxy::setApplicationProxy
will be overridden, and
usesSystemConfiguration()
will return false.
See also QNetworkProxy::setApplicationProxy(), QAbstractSocket::proxy(), and QAbstractSocket::setProxy().
Upstream PySide2 reference signatures (binding differences may apply):
setApplicationProxyFactory(factory: PySide2.QtNetwork.QNetworkProxyFactory) -> None
Source: https://doc.qt.io/archives/qt-5.15/qnetworkproxyfactory.html#setApplicationProxyFactory
setUseSystemConfiguration
setUseSystemConfiguration(enable: bool) -> None
X.setUseSystemConfiguration(enable)
Supplemental documentation: Qt 5 reference:
[static] void QNetworkProxyFactory::setUseSystemConfiguration(bool enable)
Enables the use of the platform-specific proxy settings, and only those. See systemProxyForQuery() for more information.
Calling this function with enable set to true resets any proxy or
QNetworkProxyFactory
that is already set.
Note: See the systemProxyForQuery() documentation for a list of limitations related to the use of system proxies.
This function was introduced in Qt 4.6.
Upstream PySide2 reference signatures (binding differences may apply):
setUseSystemConfiguration(enable: bool) -> None
Source: https://doc.qt.io/archives/qt-5.15/qnetworkproxyfactory.html#setUseSystemConfiguration
systemProxyForQuery
systemProxyForQuery(query: Any) -> tuple
X.systemProxyForQuery(query) -> tuple
Supplemental documentation: Qt 5 reference:
[static] QList\<QNetworkProxy> QNetworkProxyFactory::systemProxyForQuery(const QNetworkProxyQuery \&query \= QNetworkProxyQuery())
This function takes the query request, query, examines the details of the type of socket or request and returns a list of QNetworkProxy objects that indicate the proxy servers to be used, in order of preference.
This function can be used to determine the platform-specific proxy settings. This function will use the libraries provided by the operating system to determine the proxy for a given connection, if such libraries exist. If they don't, this function will just return a QNetworkProxy of type QNetworkProxy::NoProxy.
On Windows, this function will use the WinHTTP DLL functions. Despite its name, Microsoft suggests using it for all applications that require network connections, not just HTTP. This will respect the proxy settings set on the registry with the proxycfg.exe tool. If those settings are not found, this function will attempt to obtain Internet Explorer's settings and use them.
On macOS, this function will obtain the proxy settings using the SystemConfiguration framework from Apple. It will apply the FTP, HTTP and HTTPS proxy configurations for queries that contain the protocol tag "ftp", "http" and "https", respectively. If the SOCKS proxy is enabled in that configuration, this function will use the SOCKS server for all queries. If SOCKS isn't enabled, it will use the HTTPS proxy for all TcpSocket and UrlRequest queries.
On other systems, this function will pick up proxy settings from the "http_proxy" environment variable. This variable must be a URL using one of the following schemes: "http", "socks5" or "socks5h".
Limitations
These are the limitations for the current version of this function. Future versions of Qt may lift some of the limitations listed here.
- On macOS, this function will ignore the Proxy Auto Configuration settings, since it cannot execute the associated ECMAScript code.
- On Windows platforms, this function may take several seconds to execute depending on the configuration of the user's system.
Upstream PySide2 reference signatures (binding differences may apply):
systemProxyForQuery(query: PySide2.QtNetwork.QNetworkProxyQuery=...) -> typing.List[PySide2.QtNetwork.QNetworkProxy]
Source: https://doc.qt.io/archives/qt-5.15/qnetworkproxyfactory.html#systemProxyForQuery