Debian Codegraph @

/

debian rust-hyperlocal 0.9.1-1debian librust-hyperlocal-dev debian librust-hyperlocal+client-dev debian librust-hyperlocal+default-dev debian librust-hyperlocal+http-body-util-dev debian librust-hyperlocal+hyper-util-dev debian librust-hyperlocal+server-dev debian librust-hyperlocal+tower-service-dev debian librust-hyperlocal-0-dev debian librust-hyperlocal-0+client-dev debian librust-hyperlocal-0+default-dev debian librust-hyperlocal-0+http-body-util-dev debian librust-hyperlocal-0+hyper-util-dev debian librust-hyperlocal-0+server-dev debian librust-hyperlocal-0+tower-service-dev debian librust-hyperlocal-0.9-dev debian librust-hyperlocal-0.9+client-dev debian librust-hyperlocal-0.9+default-dev debian librust-hyperlocal-0.9+http-body-util-dev debian librust-hyperlocal-0.9+hyper-util-dev
10 more… debian librust-hyperlocal-0.9+server-dev debian librust-hyperlocal-0.9+tower-service-dev debian librust-hyperlocal-0.9.1-dev debian librust-hyperlocal-0.9.1+client-dev debian librust-hyperlocal-0.9.1+default-dev debian librust-hyperlocal-0.9.1+http-body-util-dev debian librust-hyperlocal-0.9.1+hyper-util-dev debian librust-hyperlocal-0.9.1+server-dev debian librust-hyperlocal-0.9.1+tower-service-dev cargo hyperlocal 0.9.1
debianjsonmakefilemarkdownrustrustrust-c-abishelltomlyaml 26 files · 160 symbols
View dependency graph

Depends on

  • dh-cargo (dh-sequence-cargo)
  • rust-hex (librust-hex-0.4+default-dev)
  • rust-http-body-util (librust-http-body-util-0.1+default-dev)
  • rust-hyper (librust-hyper-1+client-dev, librust-hyper-1+default-dev, librust-hyper-1+http1-dev, librust-hyper-1+server-dev)
  • rust-hyper-util (librust-hyper-util-0.1+client-legacy-dev, librust-hyper-util-0.1+default-dev, librust-hyper-util-0.1+http1-dev, librust-hyper-util-0.1+tokio-dev)
  • cargo, debhelper-compat, librust-pin-project-lite-0.2+default-dev, librust-tokio-1+net-dev, librust-tower-service-0.3+default-dev, libstd-rust-dev, rustc
README (full)

u

🔌 ✨

hyperlocal

Hyper client and server bindings for Unix domain sockets


Hyper is a rock solid Rust HTTP client and server toolkit. Unix domain sockets provide a mechanism for host-local interprocess communication. hyperlocal builds on and complements Hyper's interfaces for building Unix domain socket HTTP clients and servers.

This is useful for exposing simple HTTP interfaces for your Unix daemons in cases where you want to limit access to the current host, in which case, opening and exposing tcp ports is not needed. Examples of Unix daemons that provide this kind of host local interface include Docker, a process container manager.

Installation

Add the following to your Cargo.toml file

[dependencies]
hyperlocal = "0.9"

Usage

Servers

A typical server can be built by creating a tokio::net::UnixListener and accepting connections in a loop using hyper::service::service_fn to create a request/response processing function, and connecting the UnixStream to it using hyper::server::conn::http1::Builder::new().serve_connection().

hyperlocal provides an extension trait UnixListenerExt with an implementation of this.

An example is at examples/server.rs, runnable via cargo run --example server

To test that your server is working you can use an out-of-the-box tool like curl

$ curl --unix-socket /tmp/hyperlocal.sock localhost

It's a Unix system. I know this.

Clients

hyperlocal also provides bindings for writing unix domain socket based HTTP clients the Client interface from the hyper-utils crate.

An example is at examples/client.rs, runnable via cargo run --example client

Hyper's client interface makes it easy to send typical HTTP methods like GET, POST, DELETE with factory methods, get, post, delete, etc. These require an argument that can be transformed into a hyper::Uri.

Since Unix domain sockets aren't represented with hostnames that resolve to ip addresses coupled with network ports, your standard over the counter URL string won't do. Instead, use a hyperlocal::Uri, which represents both file path to the domain socket and the resource URI path and query string.


Doug Tangren (softprops) 2015-2020

dir .github/
dir debian/
dir examples/
dir src/
dir tests/
file .cargo_vcs_info.json
file .gitignore
file CHANGELOG.md
file Cargo.lock
file Cargo.toml
file Cargo.toml.orig
file LICENSE
file README.md
file rustfmt.toml