6#include <QtCore/QByteArray>
9#ifndef QT_NO_NETWORKPROXY
30 for (
const QByteArray &rawToken : noProxyTokens) {
34 if (
token.startsWith(u
'*'))
41 if (
token.startsWith(u
'.'))
51 if (host[host.
size() -
token.size() - 1] == u
'.')
70 if (queryProtocol ==
"http"_L1)
71 proxy_env =
qgetenv(
"http_proxy");
72 else if (queryProtocol ==
"https"_L1)
73 proxy_env =
qgetenv(
"https_proxy");
74 else if (queryProtocol ==
"ftp"_L1)
75 proxy_env =
qgetenv(
"ftp_proxy");
77 proxy_env =
qgetenv(
"all_proxy");
81 proxy_env =
qgetenv(
"http_proxy");
86 if (scheme ==
"socks5"_L1) {
90 }
else if (scheme ==
"socks5h"_L1) {
95 }
else if ((scheme.
isEmpty() || scheme ==
"http"_L1)
QByteArray trimmed() const &
QList< QByteArray > split(char sep) const
Splits the byte array into subarrays wherever sep occurs, and returns the list of those arrays.
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
QLatin1StringView trimmed() const noexcept
bool isEmpty() const noexcept
static QList< QNetworkProxy > systemProxyForQuery(const QNetworkProxyQuery &query=QNetworkProxyQuery())
This function takes the query request, query, examines the details of the type of socket or request a...
The QNetworkProxyQuery class is used to query the proxy settings for a socket.
The QNetworkProxy class provides a network layer proxy.
void setCapabilities(Capabilities capab)
@ HostNameLookupCapability
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLocal8Bit(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
qsizetype size() const
Returns the number of characters in this string.
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QString host(ComponentFormattingOptions=FullyDecoded) const
Returns the host of the URL if it is defined; otherwise an empty string is returned.
QString scheme() const
Returns the scheme of the URL.
int port(int defaultPort=-1) const
Combined button and popup list for selecting options.
static bool ignoreProxyFor(const QNetworkProxyQuery &query)
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
QUrl url("example.com")
[constructor-url-reference]