
Hello. I have some experience with http protocol and i have question/suggestion about implementing this protocol using asio library. Http/1.1 supports "protocol upgrades": during persistent connection client ot server can ask remote peer to upgrade protocol (push additional protocol(s) in protocol stack just before HTTP). After successful upgrading client can continue to send http-requests to server over new protocol stack. See "Upgrading to TLS Within HTTP/1.1" (http://www.faqs.org/rfcs/rfc2817.html) for examples. Currently asio doesn't allow me to implement this facility (to transform socket using simple transport protocol, like TCP, to SSL-socket in run-time). Another problem. HTTP/1.1 supports transfer-encoded bodies of packets, i.e. bodies transformed for transmission between sender and recipient (compressed, chunked etc.). Such transfer-encoded bodies are always chunked, splitted to chunks, each chunk have header with his size, zero sized chunk signals end of body. In some step of my program i would like to eliminate difference between plain bodies (reading/writing to socket) and transfer-encoded bodies (reading/writing to chain of filters). In other words i'm talking about some infrastructure like boost::iostreams but built on top of asio dispatcher. Async analogue of boost::iostreams which allows me to create async chains of filters in run-time. For example, it can be done with non-templated versions of functions async_read, async_write, handler parameter of this functions will have type like boost::function<void (asio::error, size_T)>. SSL class could be implemented as such async filter and would allow attaching at run-time.