1 #ifndef TORCHTTPSERVER_H 2 #define TORCHTTPSERVER_H 7 #include <QReadWriteLock> 53 static void HandleRequest (
const QString &PeerAddress,
int PeerPort,
const QString &LocalAddress,
int LocalPort,
TorcHTTPRequest &Request);
54 static QVariantMap
HandleRequest (
const QString &Method,
const QVariant &Parameters, QObject *Connection,
bool Authenticated);
83 bool event (QEvent *Event)
override final;
98 void StartBonjour (
void);
99 void StopBonjour (
void);
100 void StopBonjourBrowse (
void);
101 void StopBonjourAdvert (
void);
102 void StartUPnP (
void);
103 void StopUPnP (
void);
124 quint32 m_bonjourBrowserReference;
125 quint32 m_httpBonjourReference;
126 quint32 m_torcBonjourReference;
134 Q_DECLARE_METATYPE(QTcpSocket*)
135 Q_DECLARE_METATYPE(QHostAddress)
136 #endif // TORCHTTPSERVER_H bool operator==(Status Other) const
A class to encapsulate an incoming HTTP request.
void UPnPAdvertChanged(bool Advert)
High level group of related settings.
Base HTTP response handler class.
static void Authorise(const QString &Host, TorcHTTPRequest &Request, bool ForceCheck)
Ensures remote user is authorised to access this request.
A wrapper around a database setting.
Top level interface into services.
static QMutex gWebServerLock
static void AddAuthenticationHeader(TorcHTTPRequest &Request)
TorcWebSocketThread * TakeSocketPriv(TorcWebSocketThread *Socket)
bool event(QEvent *Event) overridefinal
Handles the provision of dynamic content as typically located in ~/.torc/content. ...
static void HandleRequest(const QString &PeerAddress, int PeerPort, const QString &LocalAddress, int LocalPort, TorcHTTPRequest &Request)
void BonjourSearchChanged(bool Search)
static void ValidateOrigin(TorcHTTPRequest &Request)
Check the Origin header for validity and respond appropriately.
void BonjourAdvertChanged(bool Advert)
void HandlersChanged(void)
void BonjourChanged(bool Bonjour)
void UPnPSearchChanged(bool Search)
static QVariantMap GetServiceHandlers(void)
static void RegisterHandler(TorcHTTPHandler *Handler)
void PortChanged(int Port)
static Status gWebServerStatus
static Status GetStatus(void)
static void AuthenticateUser(TorcHTTPRequest &Request)
static QString gOriginWhitelist
Handles the provision of static server content such as html, css, js etc.
static void DeregisterHandler(TorcHTTPHandler *Handler)
static QString PlatformName(void)
static TorcHTTPServer * gWebServer
void IPv6Changed(bool IPv6)
Wraps a TorcQThread around a TorcWebsocket.
void NewConnection(qintptr SocketDescriptor)
static QString ServerDescription(void)
void UPnPChanged(bool UPnP)
void SecureChanged(bool Secure)
static TorcWebSocketThread * TakeSocket(TorcWebSocketThread *Socket)
static QVariantMap GetServiceDescription(const QString &Service)
static QReadWriteLock gOriginWhitelistLock
virtual ~TorcHTTPServer()