Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get upstream ip address from a WASM filter #59

Open
NomadXD opened this issue Apr 8, 2021 · 0 comments
Open

How to get upstream ip address from a WASM filter #59

NomadXD opened this issue Apr 8, 2021 · 0 comments

Comments

@NomadXD
Copy link

NomadXD commented Apr 8, 2021

I am trying to get the upstream host ip address from a WASM filter using getValue() method. I tried ,

std::string remote_ip;
auto buffer = getValue({"upstream", "address"}, &remote_ip);
LOG_INFO("remote_ip >>>>>>>>>>>>>>>"+remote_ip);

but it's not working. It returns env.proxy_get_property return: 1 which I assume should be 0 if everything's correct. I had a look at this method https://github.com/envoyproxy/envoy/blob/c93d486c2d303dbf2cc9f88717de0bfd66e1afdb/source/extensions/common/wasm/context.cc#L490 from envoy source code and they have implemented it. Anything wrong with the way i'm using it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant