return d_ptr->peerPort();
}
+#ifndef QT_NO_NETWORKPROXY
/*!
* Returns the currently configured proxy
*/
}
/*!
+ Sets the proxy to \a networkProxy
+ */
+void QWebSocket::setProxy(const QNetworkProxy &networkProxy)
+{
+ d_ptr->setProxy(networkProxy);
+}
+#endif
+
+/*!
* Returns the size in bytes of the readbuffer that is used by the socket.
*/
qint64 QWebSocket::readBufferSize() const
#include <QUrl>
#include <QAbstractSocket>
#include <QHostAddress>
+#ifndef QT_NO_NETWORKPROXY
#include <QNetworkProxy>
+#endif
#include <QTime>
#include "qwebsocketsglobal.h"
#include "qwebsocketprotocol.h"
QHostAddress peerAddress() const;
QString peerName() const;
quint16 peerPort() const;
+#ifndef QT_NO_NETWORKPROXY
QNetworkProxy proxy() const;
- qint64 readBufferSize() const;
void setProxy(const QNetworkProxy &networkProxy);
+#endif
+ qint64 readBufferSize() const;
void setReadBufferSize(qint64 size);
void setSocketOption(QAbstractSocket::SocketOption option, const QVariant &value);
QVariant socketOption(QAbstractSocket::SocketOption option);
void connected();
void disconnected();
void stateChanged(QAbstractSocket::SocketState state);
+#ifndef QT_NO_NETWORKPROXY
void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *pAuthenticator);
+#endif
void readChannelFinished();
void textFrameReceived(QString frame, bool isLastFrame);
void binaryFrameReceived(QByteArray frame, bool isLastFrame);
#include <QRegularExpression>
#include <QStringList>
#include <QHostAddress>
+#ifndef QT_NONETWORKPROXY
#include <QNetworkProxy>
+#endif
#include <QDebug>
#include <QUrl>
#include <QAbstractSocket>
#include <QHostAddress>
+#ifndef QT_NO_NETWORKPROXY
#include <QNetworkProxy>
+#endif
#include <QTime>
#include "qwebsocketsglobal.h"
#include "qwebsocketprotocol.h"
QHostAddress peerAddress() const;
QString peerName() const;
quint16 peerPort() const;
+#ifndef QT_NO_NETWORKPROXY
QNetworkProxy proxy() const;
- qint64 readBufferSize() const;
void setProxy(const QNetworkProxy &networkProxy);
+#endif
+ qint64 readBufferSize() const;
void setReadBufferSize(qint64 size);
void setSocketOption(QAbstractSocket::SocketOption option, const QVariant &value);
QVariant socketOption(QAbstractSocket::SocketOption option);
}
/*!
+#ifndef QT_NO_NETWORKPROXY
+/*!
Returns the network proxy for this socket. By default QNetworkProxy::DefaultProxy is used.
\sa setProxy().
}
/*!
+ \brief Sets the explicit network proxy for this socket to \a networkProxy.
+
+ To disable the use of a proxy for this socket, use the QNetworkProxy::NoProxy proxy type:
+
+ \code
+ server->setProxy(QNetworkProxy::NoProxy);
+ \endcode
+
+ \sa proxy().
+*/
+void QWebSocketServer::setProxy(const QNetworkProxy &networkProxy)
+{
+ d_ptr->setProxy(networkProxy);
+}
+#endif
Returns the server's address if the server is listening for connections; otherwise returns QHostAddress::Null.
\sa serverPort() and listen().
}
/*!
- \brief Sets the explicit network proxy for this socket to \a networkProxy.
-
- To disable the use of a proxy for this socket, use the QNetworkProxy::NoProxy proxy type:
-
- \code
- server->setProxy(QNetworkProxy::NoProxy);
- \endcode
-
- \sa proxy().
-*/
-void QWebSocketServer::setProxy(const QNetworkProxy &networkProxy)
-{
- d_ptr->setProxy(networkProxy);
-}
-
-/*!
Sets the socket descriptor this server should use when listening for incoming connections to \a socketDescriptor.
Returns true if the socket is set successfully; otherwise returns false.\n
bool setSocketDescriptor(int socketDescriptor);
int socketDescriptor() const;
bool waitForNewConnection(int msec = 0, bool *timedOut = 0);
+#ifndef QT_NO_NETWORKPROXY
+ void setProxy(const QNetworkProxy &networkProxy);
+ QNetworkProxy proxy() const;
+#endif
QList<QWebSocketProtocol::Version> supportedVersions() const;
QList<QString> supportedProtocols() const;
return pWebSocket;
}
+#ifndef QT_NO_NETWORKPROXY
+/*!
+ \internal
+ */
QNetworkProxy QWebSocketServerPrivate::proxy() const
{
return m_pTcpServer->proxy();
/*!
\internal
*/
+void QWebSocketServerPrivate::setProxy(const QNetworkProxy &networkProxy)
+{
+ m_pTcpServer->setProxy(networkProxy);
+}
+#endif
/*!
\internal
*/
m_pTcpServer->setMaxPendingConnections(numConnections);
}
-void QWebSocketServerPrivate::setProxy(const QNetworkProxy &networkProxy)
-{
- m_pTcpServer->setProxy(networkProxy);
-}
-
/*!
\internal
*/
bool listen(const QHostAddress &address = QHostAddress::Any, quint16 port = 0);
int maxPendingConnections() const;
virtual QWebSocket *nextPendingConnection();
+#ifndef QT_NO_NETWORKPROXY
QNetworkProxy proxy() const;
+ void setProxy(const QNetworkProxy &networkProxy);
+#endif
QHostAddress serverAddress() const;
QAbstractSocket::SocketError serverError() const;
quint16 serverPort() const;
void setMaxPendingConnections(int numConnections);
- void setProxy(const QNetworkProxy &networkProxy);
bool setSocketDescriptor(int socketDescriptor);
int socketDescriptor() const;
bool waitForNewConnection(int msec = 0, bool *timedOut = 0);