Expand description
The httpserver capability provider allows wasmcloud components to receive and process http(s) messages from web browsers, command-line tools such as curl, and other http clients. The server is fully asynchronous, and built on Rust’s high-performance axum library, which is in turn based on hyper, and can process a large number of simultaneous connections.
§Features:
- HTTP/1 and HTTP/2
- TLS
- CORS support (select
allowed_origins
,allowed_methods
,allowed_headers
.) Cors has sensible defaults so it should work as-is for development purposes, and may need refinement for production if a more secure configuration is required. - All settings can be specified at runtime, using per-component link settings:
- bind path/address
- TLS
- Cors
- Flexible confiuration loading: from host, or from local toml or json file.
- Fully asynchronous, using tokio lightweight “green” threads
- Thread pool (for managing a pool of OS threads). The default thread pool has one thread per cpu core.
Structs§
Functions§
- Load settings provides a flexible means for loading configuration. Return value is any structure with Deserialize, or for example, HashMap<String,String> config_b64: base64-encoded json string config_json: raw json string Also accept “address” (a string representing SocketAddr) and “port”, a localhost port If more than one key is provided, they are processed in the order above. (later names override earlier names in the list)