Implement the 2023_10_18 version of web serving.#95
Implement the 2023_10_18 version of web serving.#95brendandburns wants to merge 1 commit intodispatchrun:mainfrom
Conversation
| const ModuleName = "streams" | ||
| const ( | ||
| ModuleName = "streams" | ||
| ModuleName_2023_10_18 = "wasi:io/streams@0.2.0-rc-2023-10-18" |
There was a problem hiding this comment.
I have been trying to get this PR working with https://github.com/dev-wasm/dev-wasm-go/tree/main/http without success. The first issue is that module name should be wasi:io/streams instead that dev-wasm-go client will work with that. However, still after that there is error
panic: wasm: error instantiating guest: "read" is not exported in module "wasi:io/streams"
perhaps some mismatch between versions in dev-wasm-go and wasi-go
There was a problem hiding this comment.
just thinking, could it make sense to make one working combination with wasi-go wasi_http and dev-wasm-go client?
There was a problem hiding this comment.
@zetaab dev-wasm-go unfortunately hasn't been updated (I will do that soon) there is an example here that will work:
https://github.com/brendandburns/hello-wasi-http-go
I'll try to get dev-wasm-go updated soon.
| msg := fmt.Sprintf("Failed to get request: %v\n", request) | ||
| log.Printf(msg) | ||
| doError(mod, ptr, msg) | ||
| return |
There was a problem hiding this comment.
Is this condition expected to ever happen? Or would it be better suited to panic if we hit it?
There was a problem hiding this comment.
This condition will happen if someone loads a WASM binary that doesn't export the right function.
In such a situation, it feels like the right thing to do is have the server return a 500 error, as opposed to crashing via panic()
Brings this implementation up to date with the 2023_10_18 version of the Wasi-http spec.