We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am attempting to write a wasip2 module that makes http requests.
Code:
package main import ( "fmt" "io" "log" "net/http" ) func main() { resp, err := http.Get("https://ifconfig.so") if err != nil { log.Fatal(err) } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(string(body)) }
I compile my program with tiny go using the following command: tinygo build -o main.wasm -target=wasip2 main.go
tinygo build -o main.wasm -target=wasip2 main.go
Then I attempt to run my wasi module with wasmtime using the following command: wasmtime run -S http=y main.wasm
wasmtime run -S http=y main.wasm
I expect to get an IP address returned from the web request. Instead, I receive a message stating: Netdev not set
Netdev not set
I'm struggling to figure out how to write WASI 2.0 modules in go that make http requests. Is there any guidance on how to do this?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am attempting to write a wasip2 module that makes http requests.
Code:
I compile my program with tiny go using the following command:
tinygo build -o main.wasm -target=wasip2 main.go
Then I attempt to run my wasi module with wasmtime using the following command:
wasmtime run -S http=y main.wasm
I expect to get an IP address returned from the web request. Instead, I receive a message stating:
Netdev not set
I'm struggling to figure out how to write WASI 2.0 modules in go that make http requests. Is there any guidance on how to do this?
The text was updated successfully, but these errors were encountered: