proxy-wasm / proxy-wasm-cpp-sdk

WebAssembly for Proxies (C++ SDK)
Apache License 2.0
140 stars 68 forks source link

Does envoy or envoy wasm c++ sdk support caching of http request and response body #118

Open CalbeeMing0530 opened 3 years ago

CalbeeMing0530 commented 3 years ago

I deployed Envoy wasm plugin in Istio environment,  and use wasm c++ sdk to operate on http requests,I found that the current onRequestBodymethod does not seem to have a cache operation for the request body, what I want is to have this cache operation so that the request or response body can be accumulated to a certain size before being detected and processed.for example, I can set a buffer size of 10K, only when the request payload accumulated to 10K can trigger the processing logic. Is there any consideration for this in the future ? or Envoy already has this configuration, looking forward to your reply. Also,Does wasm currently support breakpoint debugging inside the envoy wasm sandbox using a gdb-like approach?

coolg92003 commented 1 year ago

I think you can define a 10K buffer in stream context, if the bodysize >0, then cache it by each call onReq/RespBody. The only I worried whether it can definitively call onReq/RespBody() once it is endStream