diff options
Diffstat (limited to 'src/websockets/qwebsocket_p.cpp')
-rw-r--r-- | src/websockets/qwebsocket_p.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/websockets/qwebsocket_p.cpp b/src/websockets/qwebsocket_p.cpp index 3ed8d8d..b9504f8 100644 --- a/src/websockets/qwebsocket_p.cpp +++ b/src/websockets/qwebsocket_p.cpp @@ -1045,6 +1045,10 @@ void QWebSocketPrivate::processStateChanged(QAbstractSocket::SocketState socketS Q_ASSERT(m_pSocket); Q_Q(QWebSocket); QAbstractSocket::SocketState webSocketState = this->state(); + int port = 80; + if (m_request.url().scheme() == QStringLiteral("wss")) + port = 443; + switch (socketState) { case QAbstractSocket::ConnectedState: if (webSocketState == QAbstractSocket::ConnectingState) { @@ -1059,7 +1063,7 @@ void QWebSocketPrivate::processStateChanged(QAbstractSocket::SocketState socketS createHandShakeRequest(m_resourceName, m_request.url().host() % QStringLiteral(":") - % QString::number(m_request.url().port(80)), + % QString::number(m_request.url().port(port)), origin(), QString(), QString(), |