All pastes #894895 Raw Edit

Vermischtes

public text v1 · immutable
·published 2008-02-07 11:52 UTC
rendered paste body
#include <QCoreApplication>

#include <QxtWebScgiConnector>
#include <QxtWebHttpConnector>

int main(int argc, char *argv[])
{
	QCoreApplication app(argc, argv);
	//
	
    
	QxtWebHttpConnector c;
	c.start ( 4030, QHostAddress::LocalHost );
    
	forever
	{
		c.waitForNewConnection(-1);
		QxtWebStatelessConnection *st = c.nextPendingConnection();
		if( st ) {
			st->waitForReadyRead(10000);
		
			QTextStream stream(st);
			stream<<"<html><head>";
			stream<<"<title>"<<st->request().path()<<"</title>";
			stream<<"</head><body>";
			stream<<"<h1>HAI! I CAN HAZ HTML!</h1>";
			stream<<"</body></html>";
			stream.flush();
			delete (st);
		}
	}
	
	return app.exec();
}