From 9440ee8df0cbf374a3cf54ff72543ebfa1ab7898 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 29 Oct 2018 15:18:41 +0100 Subject: 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 --- src/websockets/qwebsocket_p.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/websockets/qwebsocket_p.cpp') 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 { -- cgit v1.2.3