Question: Reset/forward body stream
In a scenario where I have a server reading data from the POST body, and then upon some algorithm forwarding that to a second HTTP POST, I would like to be able to forward the whole buffer in the body without reading it first.
IE to read some bytes from the stream, then send the whole stream to another server.
Is this possible? I do not see how today because I cannot seek back to the beginning. Possible to add this? (Seeking or forwarding)
cheers
Matt
Seeking isn't possible, you'd need to add your own buffering layer.
I only want to seek back to zero. The whole point is to not add the overhead of a buffering layer - I just want to pipe it straight through after having peeked at a few bytes
https://github.com/Drawaes/CondenserDotNet/blob/master/src/CondenserDotNet.Middleware/ProtocolSwitcher/BackToBackStream.cs
Something like but buffering more than 1 byte?
By definition you will have to buffer the bytes you have read in any solution. But after that just pass the stream data through
The BackToBack stream is perfect inspiration, thanks