Skip to content

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

@NomadXD

Description

@NomadXD

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions