Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 901 Bytes

README.md

File metadata and controls

27 lines (19 loc) · 901 Bytes

PCacheProxy

This is a prototype of a C++ HTTP 1.1 caching proxy using the Poco C++ library.

Currently implemented is a non-cache proxy mode, and a simple cache-to-memory mode.

Standalone sample

	// use a memory cache
	PCacheProxy::Service proxy(new PCacheProxy::MemoryCache);

	// create an http request
	Poco::Net::HTTPRequest req("GET", "http://www.sibit.com.br", Poco::Net::HTTPRequest::HTTP_1_1);

	Poco::Net::HTTPResponse resp;
	std::stringstream respout;

	// request using the proxy, may return/store requests previously cached
	proxy.request(PCacheProxy::RequestStream(req), PCacheProxy::ResponseStream(resp, respout));

	std::cout << "==================== REQUEST OUTPUT ====================" << std::endl;
	std::cout << respout.str() << std::endl;
	std::cout << "====================" << std::endl;

Author

Rangel Reale ([email protected])