Your Own Personal WEB Server

"Нечего делать" - это очень сильный стимул. Иногда человек от нечего делать делает гораздо больше, чем от стимула "надо сделать". Это типа эпиграф такой, хех...

Dynamic Content Generator Protocol

...To be implemented...

DCGP is planned alternative to CGI/FastCGI/etc.

The idea resembles FastCGI, in some extent. Content Generator (CONG) is special HTTP-client, that connects to the server and registers itself, indicating it's name. After a CONG has been registered, server forwards requests with URL, that starts with some CONG name, to that CONG.

CONGs can be written in any language and when are written in, for ex. C/C++, can use all of the power/features of an OS (ie syscalls) directly. Well, writing, say, an internet forum engine in C might sound crazy, but anyway, anyway... :)

The meaning of the word 'dynamic' in the name of the protocol is twofold: the word refers both to the word 'content' and to the word 'generator'. 'Dynamic content' is self explanatory. Under 'Dynamic generator' i mean the property that CONGs can connect (register themselves) and disconnect (and thus automatically unregister) at any moment.

The protocol itself

...In progress...

In order to register as a CONG, HTTP-client must send following request:


	DCGP test HTTP/1.1\r\n\
	Host: does.not.matter\r\n\
	User-Agent: test-cong\r\n\
	\r\n\                      

The word after 'DCGP' is the name of the CONG ('test' in the example above). As you can see, 'DCGP' is a special HTTP-method.

In response to such a request HTTP-server... to be continued...


	HTTP/1.1 600 Content Generator Accepted\r\n\
	Date: Wed, 28 Sep 2011 07:49:19 GMT\r\n\
	Connection: Keep-Alive\r\n\
	Server: swebs\r\n\
	Content-Length: 30\r\n\
	Content-Type: text/plain\r\n\
	\r\n\
	600 Content Generator Accepted

Request forwarded to the CONG:


	GET /test/sdvfv HTTP/1.1\r\n
	User-Agent: Mozilla/5.0\r\n
	X-DCGP-JOB-ID: test_$U8pd6fAwUHR3yI9CHOlG50$7b001a14cb6bbb4a\r\n
	\r\n

CONG reply:


	test_$U8pd6fAwUHR3yI9CHOlG50$7b001a14cb6bbb4a:000000000000007d\r\n
	HTTP/1.1 200 OK\r\n
	Content-Length: 86\r\n
	\r\n
	... BODY OF THE DOCUMENT...