Skip to content

Conversation

@sunfishcode
Copy link
Member

Add a wstd API for creating HTTP server applications, wrapping the WASI proxy world trait and macro.

This is split out from #34 to separate it from the client API changes for easier reviewing.

Add a wstd API for creating HTTP server applications, wrapping the
WASI proxy world trait and macro.

Compiling the example with `RUSTFLAGS="-Clink-arg=--wasi-adapter=proxy"`
produces a program that runs in `wasmtime serve`.
@sunfishcode

This comment was marked as resolved.

@sunfishcode sunfishcode reopened this Jan 10, 2025
Copy link
Contributor

@pchickey pchickey left a comment

Choose a reason for hiding this comment

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

This is a lot of really great work! Various quibbles.

.map_err(|_| WasiHttpErrorCode::HttpRequestMethodInvalid)?;
let scheme = match incoming.scheme() {
Some(scheme) => Some(
from_wasi_scheme(scheme).expect("TODO: what shall we do with an invalid uri here?"),
Copy link
Contributor

Choose a reason for hiding this comment

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

I think there's a good answer to all of these expect/todos when using wstd::error::Error so can we clean all those up before landing?

Copy link
Contributor

@pchickey pchickey left a comment

Choose a reason for hiding this comment

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

This looks good to go, if needed we can golf on some of the error TODOs later without changing any interfaces, so we can land this whenever you are ready.

@pchickey pchickey merged commit 35f28d2 into bytecodealliance:main Jan 13, 2025
4 checks passed
@sunfishcode sunfishcode deleted the sunfishcode/http-server branch January 14, 2025 17:24
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