#hyper-client #unix-socket #sockets #hyper #client #firecracker

hyper-client-sockets

A Hyper client library allowing access to Unix, VSock and Firecracker sockets

7 unstable releases (3 breaking)

0.4.0 Nov 20, 2024
0.3.1 Nov 19, 2024
0.2.2 Nov 18, 2024
0.2.0 Oct 8, 2024
0.1.0 Jul 18, 2024

#180 in HTTP client

Download history 13/week @ 2024-09-16 10/week @ 2024-09-23 153/week @ 2024-10-07 23/week @ 2024-10-14 1/week @ 2024-10-21 4/week @ 2024-11-04 751/week @ 2024-11-18 14/week @ 2024-11-25 42/week @ 2024-12-02

807 downloads per month
Used in fctools

MIT license

39KB
765 lines

Hyper Client Sockets

Before hyper v1, hyperlocal was the most convenient solution to use Unix sockets for both client and server. With hyper v1, server socket support is no longer needed (just use UnixListener or VsockListener instead of TcpListener), yet hyperlocal still has it and hasn't received a release since several years.

This library provides hyper v1 client support for:

  • Unix (AF_UNIX) sockets (HyperUnixStream implementing hyper traits)
  • VSock (AF_VSOCK) sockets (HyperVsockStream implementing hyper traits)
  • Firecracker Unix sockets that need CONNECT commands in order to establish a tunnel (HyperFirecrackerStream implementing hyper traits)

Additionally, the library supports different async I/O backends:

  • Tokio using tokio-backend
  • async-io stack using async-io-backend

The backend to use when connecting can be specified with the Backend enum. Compiling with both backends enabled is supported but not recommended, and leaving the choice of backend to the user is recommended for library developers.

Lastly, the connector feature provides compatibility with hyper-util's Client connection pool.

Dependencies

~3–14MB
~185K SLoC