#webassembly #wasm #wasi #wascc #actix

wascc-httpsrv

HTTP Server capability provider for the waSCC wasm host runtime

5 releases (3 breaking)

0.9.2 Jan 13, 2021
0.9.0 Oct 28, 2020
0.8.1 Sep 24, 2020
0.7.0 Jun 4, 2020
0.6.0 Apr 3, 2020

#491 in WebAssembly

Download history 6/week @ 2021-02-26 4/week @ 2021-03-05 35/week @ 2021-03-12 17/week @ 2021-03-19 13/week @ 2021-03-26 12/week @ 2021-04-02 8/week @ 2021-04-09 21/week @ 2021-04-16 12/week @ 2021-04-23 12/week @ 2021-04-30 2/week @ 2021-05-07 7/week @ 2021-05-14 4/week @ 2021-05-21 4/week @ 2021-05-28 3/week @ 2021-06-04 10/week @ 2021-06-11

59 downloads per month

Apache-2.0

18KB
355 lines

crates.io  Rust license  documentation

waSCC HTTP Server Provider

This library is a native capability provider for the wascc:http_server 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 waSCC host runtime as a plugin. If you want to statically compile (embed) it into a custom waSCC host, then simply enable the static_plugin feature in your dependencies:

wascc-httpsrv = { version = "0.9.0", 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 schemas repository.

For more hands-on tutorials on building actors, including HTTP server actors, see the wascc.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

~23MB
~517K SLoC