Envoy proxy server : how to preserve socket options?

Viewed 471

So, I need to set DSCP byte for HTTP/2 traffic on client side, which is an IP header. This is easily done using setsockopt IP_TOS on the socket sending the HTTP POST request.

But, we are using istio in our project, hence all traffic goes through envoy proxy, and I verified that the envoy proxy is stripping away all IP headers when proxying.

Ie, client sends http post to envoy with DSCP set -> envoy sends HTTP post to the actual recipient, but all IP headers set by setsockopt is gone.

Looking at envoy documentation, it seems that the solution is to use a 'tcp filter', and envoy already has a selection of filters inbuilt: https://github.com/envoyproxy/envoy/tree/main/source/extensions/transport_sockets

But, sadly, the documentation is quite cryptic. But this must be a common requirement, so does anyone know how to get envoy to preserve IP headers set by setsockopt?

Thank you for any advice!

1 Answers
Related