-
Notifications
You must be signed in to change notification settings - Fork 29
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
Can I use it in wasmedge's cpp api? #30
Comments
Hi @arcosx, This is for creating the wasm application, wasmedge provides the wasi-socket api support by default. All you need to do is use this SDK to compose your application, compile it to wasm, and then embed in our wasmedge. Please refer to our example page for how to compile it. And just put the output wasm file in the our API. Thanks. |
Thanks for the help, I tried to use http req and ran into the following problem. cargo build --target wasm32-wasi --release
wasmedge target/wasm32-wasi/release/http_client.wasm on master code I run the ...
let res = request::get("http://127.0.0.1:1234/get", &mut writer).unwrap();
... works fine
but if I change to other url let res = request::get("http://httpbin.org/get", &mut writer).unwrap(); It get error ➜ http_client git:(ad123cc) ✗ wasmedge target/wasm32-wasi/release/http_client.wasm
thread 'main' panicked at 'Expected error to be io::Error, got: IO(Error { kind: Unsupported, message: "operation not supported on this platform" })', src/main.rs:7:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[2021-12-17 22:50:47.407] [error] execution failed: unreachable, Code: 0x89
[2021-12-17 22:50:47.407] [error] In instruction: unreachable (0x00) , Bytecode offset: 0x000156cb
[2021-12-17 22:50:47.407] [error] When executing function name: "_start" My OS
|
Hi @arcosx We are still working on this. You can find a working PR in WasmEdge project. |
Thank you again for your help, the answers were very helpful to me. Looking forward to the PR being merged. |
I want to embed a http request in wasm in a C++ program.Can you give me some advice?
The text was updated successfully, but these errors were encountered: