Skip to content
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

Implement wasi-http serving. #88

Merged
merged 1 commit into from
Jul 26, 2023

Conversation

brendandburns
Copy link
Contributor

@brendandburns brendandburns commented Jul 18, 2023

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.

Copy link
Contributor

@achille-roussel achille-roussel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good, thanks for adding tests!

I'm OK with adding options on wasirun to exercise the features supported in this package 👍

I'm curious about the new types module that this PR introduces, do you know if it is described somewhere a specification, or is there another runtime implementing it?

@brendandburns
Copy link
Contributor Author

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
Copy link
Contributor Author

brendandburns commented Jul 26, 2023

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
Copy link
Contributor

Thanks for the explanations!

@achille-roussel achille-roussel merged commit 7cfbd27 into dispatchrun:main Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants