Expand description
TCP sockets and HTTP for WASI programs in slicc’s kernel.
Rust std for wasm32-wasip1 stubs TcpStream::connect and
TcpListener::bind. slicc’s kernel implements the WASIX socket calls
(sock_open, sock_connect, sock_bind, sock_listen,
sock_accept_v2) on its own loopback network, so on WASI preview1 this
crate’s TcpStream and TcpListener use them. On every other target
they are std’s, so code written against them needs no cfg: switch the
import and keep to the API both share.
http is a small blocking HTTP/1.1 client over those sockets. It has
no TLS: in the realm every request leaves through the kernel’s proxy
(https_proxy / http_proxy), which takes absolute-form requests and
does TLS itself, while hosts in no_proxy (the realm’s loopback) are
reached directly.
Modules§
- http
- A small blocking HTTP/1.1 client.
Structs§
- Incoming
- An iterator that infinitely
accepts connections on aTcpListener. - Ipv4
Addr - An IPv4 address.
- Ipv6
Addr - An IPv6 address.
- Socket
Addr V4 - An IPv4 socket address.
- Socket
Addr V6 - An IPv6 socket address.
- TcpListener
- A TCP socket server, listening for connections.
- TcpStream
- A TCP stream between a local and a remote socket.
Enums§
- IpAddr
- An IP address, either IPv4 or IPv6.
- Shutdown
- Possible values which can be passed to the
TcpStream::shutdownmethod. - Socket
Addr - An internet socket address, either IPv4 or IPv6.
Traits§
- ToSocket
Addrs - A trait for objects which can be converted or resolved to one or more
SocketAddrvalues.
Functions§
- resolve
- The addresses of
host(a name or a literal address) atport.