#webassembly #wasm #wasi #wasmcloud #actix

wasmcloud-httpserver

HTTP Server capability provider for the wasmCloud host runtime

4 releases

0.12.1 Mar 18, 2021
0.12.0 Mar 4, 2021
0.11.1 Feb 11, 2021
0.11.0 Feb 11, 2021

#405 in WebAssembly

Download history 67/week @ 2021-02-10 37/week @ 2021-02-17 16/week @ 2021-02-24 35/week @ 2021-03-03 6/week @ 2021-03-10 62/week @ 2021-03-17 33/week @ 2021-03-24 27/week @ 2021-03-31 48/week @ 2021-04-07 11/week @ 2021-04-14 19/week @ 2021-04-21 4/week @ 2021-04-28

58 downloads per month

Apache-2.0

16KB
276 lines

crates.io  Rust license  documentation

wasmCloud HTTP Server Provider

This library is a native capability provider for the wasmcloud:httpserver capability. Only actors signed with tokens containing this capability privilege will be allowed to use it.

It should be compiled as a native shared object binary (linux .so, mac .dylib, windows .dll) and made available to the wasmCloud host runtime as a plugin. If you want to statically compile (embed) it into a custom wasmCloud host, then simply enable the static_plugin feature in your dependencies:

wasmcloud-httpserver = { version = "0.11.1", features = ["static_plugin"] }

To create an actor that makes use of this capability provider, make sure that a configuration is supplied at runtime and includes a PORT variable. This will enable the HTTP server and direct all requests to your actor module, which you can handle by checking that a dispatched operation is equivalent to the constant OP_HANDLE_REQUEST. For more information on the various types available to HTTP-based actors, check out the actor-interfaces repository.

For more hands-on tutorials on building actors, including HTTP server actors, see the wasmcloud.dev website.

NOTE: If multiple actors within the same host process request HTTP server configurations, each actor will get its own HTTP server. Be careful not to request the same HTTP port for multiple actors in the same host process, as this will cause the host process to reject the configuration/binding.

Dependencies

~19MB
~462K SLoC