4 #include "httphandler.h"
12 class QNetworkAccessManager;
13 class QNetworkCookieJar;
25 class ProxyContext : public QObject
28 friend class ProxyHandler;
31 ProxyContext(QString prefix, quint16 http, quint16 socket);
34 QNetworkAccessManager *m_manager;
35 QNetworkCookieJar *m_cookie;
42 class ProxyModule : public HttpModule
47 ProxyModule(QString prefix, quint16 http, quint16 socket, QObject *parent);
50 virtual HttpHandler* create_handler(QByteArray method, QByteArray url);
51 virtual void destroy_handler(HttpHandler *handler);
55 ProxyContext *m_context;
61 class ProxyHandler : public HttpHandler
66 ProxyHandler(ProxyContext *context);
72 void onNetworkReplyFinished();
78 Html::pointer sanitize(Html::pointer p);
79 //void sanitize_attribute(Html::pointer p, QString name_);
80 QString create_href(QString href);
81 void create_paragraph(Html::pointer begin_, Html::pointer tail_);
83 // void sanitize_document(HtmlDocument document);
84 // void sanitize_node(HtmlRange &range, HtmlRange::iterator it);
85 // void create_paragraph(HtmlRange body);
88 QString prefix() const;
91 ProxyContext *m_context;
92 QNetworkReply *m_reply;