Skip to content

how to read file in wasm #117

Open
Open
@Snailll

Description

@Snailll

In the wasm filter ,I want to read some configurations from file.
I wrote some code in the onConfigure part like this

    std::string data;
    std::ifstream infile;
    infile.open("/configurations.json");
    infile >> data;;
    infile.close();
    LOG_ERROR("configurations -> " + data);

Howerev, I cannot get any content of the configuration file.

How to read a configuration file in wasm ? Is there a file read API in the proxy-wasm-cpp-sdk?

Ths.

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