proxy-wasm-cpp-sdk icon indicating copy to clipboard operation
proxy-wasm-cpp-sdk copied to clipboard

Is it possible to get underlying socket?

Open VivekSubr opened this issue 3 years ago • 1 comments

Hello!

Looking at the doc, looks like you can only write filters at Layer7? Envoy can also proxy tcp connections, and what if someone wants to do stuff with socket options? Is there any way to get the underlying socket for a given request?

Perhaps what I'm looking for is support for https://www.envoyproxy.io/docs/envoy/latest/configuration/listeners/network_filters/wasm_filter?

VivekSubr avatar Jul 21 '22 11:07 VivekSubr

You can write HTTP or TCP filters, but you cannot access underlying TCP connection from HTTP filter, since it can carry more than a single request.

For TCP filters, you should override those functions: https://github.com/proxy-wasm/proxy-wasm-cpp-sdk/blob/master/proxy_wasm_api.h#L455-L459

PiotrSikora avatar Jul 21 '22 17:07 PiotrSikora