Skip to main content

Crate wasix_net

Crate wasix_net 

Source
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 a TcpListener.
Ipv4Addr
An IPv4 address.
Ipv6Addr
An IPv6 address.
SocketAddrV4
An IPv4 socket address.
SocketAddrV6
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::shutdown method.
SocketAddr
An internet socket address, either IPv4 or IPv6.

Traits§

ToSocketAddrs
A trait for objects which can be converted or resolved to one or more SocketAddr values.

Functions§

resolve
The addresses of host (a name or a literal address) at port.