summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2018-10-29 15:18:41 +0100
committerAndy Shaw <andy.shaw@qt.io>2018-12-26 00:27:03 +0000
commit9440ee8df0cbf374a3cf54ff72543ebfa1ab7898 (patch)
tree463ee4e9af2647b730873ad7f847ea33cb58aa5f
parentbc1b6ac5ad0ce608e3b4c7f87c2405aa595735d7 (diff)
downloadqtwebsockets-9440ee8df0cbf374a3cf54ff72543ebfa1ab7898.tar.gz
Set the protocol type so that PAC scripts handle ws/wss correctly
On macOS it will only allow proxies in a PAC script to use http/https protocols, so this enables them to work by automatically setting these as the type instead. Change-Id: I66589057d40d135229cbae4986ef0819287ea69a Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
-rw-r--r--src/websockets/qwebsocket_p.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/websockets/qwebsocket_p.cpp b/src/websockets/qwebsocket_p.cpp
index a460109..c8bee53 100644
--- a/src/websockets/qwebsocket_p.cpp
+++ b/src/websockets/qwebsocket_p.cpp
@@ -436,6 +436,7 @@ void QWebSocketPrivate::open(const QNetworkRequest &request, bool mask)
sslSocket->ignoreSslErrors(m_configuration.m_ignoredSslErrors);
#ifndef QT_NO_NETWORKPROXY
sslSocket->setProxy(m_configuration.m_proxy);
+ m_pSocket->setProtocolTag(QStringLiteral("https"));
#endif
sslSocket->connectToHostEncrypted(url.host(), quint16(url.port(443)));
} else {
@@ -458,6 +459,7 @@ void QWebSocketPrivate::open(const QNetworkRequest &request, bool mask)
setSocketState(QAbstractSocket::ConnectingState);
#ifndef QT_NO_NETWORKPROXY
m_pSocket->setProxy(m_configuration.m_proxy);
+ m_pSocket->setProtocolTag(QStringLiteral("http"));
#endif
m_pSocket->connectToHost(url.host(), quint16(url.port(80)));
} else {