dispatchrun / wasi-go

A Go implementation of the WebAssembly System Interface (WASI)
Apache License 2.0
124 stars 7 forks source link

Implement wasi-http serving. #88

Closed brendandburns closed 1 year ago

brendandburns commented 1 year ago

cc @achille-roussel

This implements HTTP serving in the wasi-http specification. It enables wasi-run to act as an HTTP server for web assembly.

Let me know if you'd prefer that this was in a different binary.

There are C and Go examples.

brendandburns commented 1 year ago

The types module is defined in this WIT file:

https://github.com/WebAssembly/wasi-http/blob/main/wit/types.wit

Note that the fact that it is called types is actually due to a bug in the wit-bindgen tool which didn't use namespaces correctly.

When we revise this forward to be a v2 the name of this module will move to wasi::http::

brendandburns commented 1 year ago

Just for context, there is an intersection between the wit files, the wit-bindgen tool and the guest SDK that is used to access the functionality.

I will send a PR to improve the documentation of how this works.

achille-roussel commented 1 year ago

Thanks for the explanations!