Right now, we relay client requests (and server responses) byte-for-byte. We need to switch from replaying recorded bytes to generating HTTP messages, for a few reasons:
Compliant HTTP proxies (which we aspire to be) are required to add/modify headers on occasion
We need this for JIT modification of requests/responses
We need this for originating new requests
What we need to do is teach HttpMessage how to represent itself as a bytestring. This ideally will minimize memory copies, but practically speaking it's fine for a first pass to dump it all into a stringstream. Ideally we'd just yield an iterator and be dynamic about it; that's considerably tougher, at least in my imagination.
Right now, we relay client requests (and server responses) byte-for-byte. We need to switch from replaying recorded bytes to generating HTTP messages, for a few reasons:
What we need to do is teach
HttpMessage
how to represent itself as a bytestring. This ideally will minimize memory copies, but practically speaking it's fine for a first pass to dump it all into a stringstream. Ideally we'd just yield an iterator and be dynamic about it; that's considerably tougher, at least in my imagination.