wasi-net

Crates.iowasi-net
lib.rswasi-net
version0.4.0
sourcesrc
created_at2021-11-09 20:25:04.906146
updated_at2021-11-19 09:26:30.202999
descriptionInterface used to make web requests on WASI operating systems
homepage
repositoryhttps://github.com/john-sharratt/ate
max_upload_size
id479050
size65,569
Wasmer Core (github:wasmerio:wasmer-core)

documentation

README

WASI Network Interface

This library allows applications compiled to WASI to have access to HTTP and HTTPS queries that support the interface.

Consuming this library is simple, simply link to it and use the builder to construct an API request.

On the server side the following must be implemented

  1. Create a virtual file under /dev/web
  2. Listen for writes to the file that terminate with a \n
  3. The first line received is the URL to connect to
  4. The second line is the HTTP method to use (e.g. GET,PUT,etc)
  5. The third line is an encoded set of headers (base64 encoded JSON representation of a Vec<(String, String)>
  6. The last line is the data to set (zero bytes means no data)
  7. Then make the HTTP request and allow the file handle to read the data

Missing features

While it is possible to add request headers, it is not yet possible read response headers as the ability to iterate them using web-sys is not yet implemented upstream

Testing

You can test your WASI program by uploading it to wapm.io and then heading over to the Tokera Shell

https://sh.tokera.com

Commit count: 2187

cargo fmt