Skip to main content

dhttp API bindings

dhttp-api publishes language bindings for the Rust dhttp endpoint facade.

Node SDK

@genmeta/dhttp follows Node/Undici. Root exports Endpoint, callable Service, standard Web Request/Response/Headers/ReadableStream, plain object EndpointOptions, and authority capability interfaces. @genmeta/dhttp/raw exposes Connection, UnresolvedRequest, MessageReader, MessageWriter, and HeaderField.

Node entry points

import { Endpoint, Service } from "@genmeta/dhttp";
import { Connection, UnresolvedRequest } from "@genmeta/dhttp/raw";

CommonJS is also supported:

const { Endpoint, Service } = require("@genmeta/dhttp");
const raw = require("@genmeta/dhttp/raw");

Node endpoint options

const endpoint = await Endpoint.create({
  identity,
  dnsSchemes: ["h3", "mdns", "system"],
  bindPatterns: ["*"],
});

EndpointOptions is a plain object TypeScript interface. There is no public new EndpointOptions() helper in the root package.

Node server API

Endpoint.listen(function) receives raw UnresolvedRequest objects:

endpoint.listen(async (request) => {
  const headers = await request.reader.readHeader();
  await request.writer.writeHeader([
    {
      name: new TextEncoder().encode(":status"),
      value: new TextEncoder().encode("204"),
    },
  ]);
  await request.writer.close();
});

For Request -> Response, use Service:

const service = new Service()
  .get("/hello", () => new Response("hello"))
  .fallback(() => new Response("not found", { status: 404 }));

endpoint.listen(service);

Service is a callable raw handler created with new Service(). Service.from(handler) converts a high-level Fetch handler into a service.

Node raw request connection context

UnresolvedRequest does not expose connection, but it remains an aggregate raw request context. Need identity information through explicit connection endpoints:

await request.localAuthority();
await request.remoteAuthority();

The accepted peer connection context is not an owner Connection handle and is not exposed as one.

Node RequestInit policy fields

credentials, cache, mode, keepalive, and priority preserve standard Request shape but currently do not provide browser cookie/cache/CORS/page-lifecycle behavior. Endpoint identity is endpoint/connection configuration and is not controlled by Request.credentials.

Non-empty integrity is not supported. window must be unset or null.

Python SDK

Python root dhttp follows aiohttp for high-level client and server APIs. Raw DHTTP message primitives live under dhttp.raw.

Python client

endpoint = await dhttp.Endpoint.create(dns_schemes=["h3", "mdns", "system"])

async with endpoint.post("https://peer.example/items", json={"name": "reimu"}) as response:
    data = await response.json()

Python raw server

async def raw_handler(request: dhttp.raw.UnresolvedRequest) -> None:
    await request.writer.write_header([dhttp.raw.HeaderField(b":status", b"204")])
    await request.writer.close()

handle = endpoint.listen(raw_handler)

Python high-level server

service = dhttp.Service().get("/hello", lambda request: dhttp.Response.text("hello"))
handle = endpoint.listen(service)

Python raw primitives

dhttp.raw.Connection.open_request() returns aggregate UnresolvedRequest, which keeps local_authority() / remote_authority() endpoint accessors. MessageReader exposes read_header(), read_data(), and stop(code). MessageWriter exposes write_header(headers), write_data(data), flush(), close(), and reset(code).

Python breaking changes

Removed Python public names: EndpointOptions, ReadStream, WriteStream, IncomingStream, StreamPair, LocalAuthorityImpl, RemoteAuthorityImpl, open_request_stream, listen_streams, read_header_frame, read_data_frame_chunk, send_header, and send_data.

Use keyword arguments to Endpoint.create(...), dhttp.raw primitives, Connection.open_request(), Endpoint.listen(...), MessageReader.read_*, and MessageWriter.write_* instead.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dhttpy-0.3.0-cp313-cp313-win_amd64.whl (6.0 MB view details)

Uploaded CPython 3.13Windows x86-64

dhttpy-0.3.0-cp313-cp313-manylinux_2_34_x86_64.whl (7.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

dhttpy-0.3.0-cp313-cp313-macosx_11_0_arm64.whl (6.6 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

dhttpy-0.3.0-cp312-cp312-win_amd64.whl (6.0 MB view details)

Uploaded CPython 3.12Windows x86-64

dhttpy-0.3.0-cp312-cp312-manylinux_2_34_x86_64.whl (7.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

dhttpy-0.3.0-cp312-cp312-macosx_11_0_arm64.whl (6.6 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

dhttpy-0.3.0-cp311-cp311-win_amd64.whl (6.0 MB view details)

Uploaded CPython 3.11Windows x86-64

dhttpy-0.3.0-cp311-cp311-manylinux_2_34_x86_64.whl (7.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

dhttpy-0.3.0-cp311-cp311-macosx_11_0_arm64.whl (6.6 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

dhttpy-0.3.0-cp310-cp310-win_amd64.whl (6.0 MB view details)

Uploaded CPython 3.10Windows x86-64

dhttpy-0.3.0-cp310-cp310-manylinux_2_34_x86_64.whl (7.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

dhttpy-0.3.0-cp310-cp310-macosx_11_0_arm64.whl (6.6 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file dhttpy-0.3.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: dhttpy-0.3.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 6.0 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dhttpy-0.3.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 10fca10bee35856b491297f05d5c451ce3e6e2037c33e720f3e0162be94c2625
MD5 4d83f792b1267b67f3ac4ebf72b683de
BLAKE2b-256 4632b2721c3e8f75598d3221b73f2f1e3f6c9fb15851d24e2150a408361c164f

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhttpy-0.3.0-cp313-cp313-win_amd64.whl:

Publisher: publish-pypi.yml on genmeta/dhttp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dhttpy-0.3.0-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for dhttpy-0.3.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 61d3001c62e29393b6acd912bc506da31afdbe9c284246c8ed98480b04bd728e
MD5 7ee92cc2682f532abcd31e405b4c5c37
BLAKE2b-256 cc46a08325d9b9e4ddf987cdd4388e6489761177fcb7176575ce7b6732af9c26

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhttpy-0.3.0-cp313-cp313-manylinux_2_34_x86_64.whl:

Publisher: publish-pypi.yml on genmeta/dhttp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dhttpy-0.3.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dhttpy-0.3.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 63040ffa25251082b7ed6bf2b280fd46d6660b21749cf8cbe03e10fd4f95d641
MD5 be2e144d4e368d3ae4145e264d908d3f
BLAKE2b-256 9c038f3c2040f69d473e5a8d38172a88d564d19d2223121fb9252bc1dcb5d8c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhttpy-0.3.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: publish-pypi.yml on genmeta/dhttp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dhttpy-0.3.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: dhttpy-0.3.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 6.0 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dhttpy-0.3.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 14221db3e06e649401340cc29df225e3d304fef914b8b8922bbe3e55cc05275f
MD5 f86833d3028372732fbcd21136ffab95
BLAKE2b-256 106e834ae7065cbacdc7dc2148057dea3b8e7f708b643d2ae0f741c49a4293e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhttpy-0.3.0-cp312-cp312-win_amd64.whl:

Publisher: publish-pypi.yml on genmeta/dhttp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dhttpy-0.3.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for dhttpy-0.3.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 6cebbe71e6ef04ca732ad5ad92ed76ee389e0686d9bbc6809386cf8b682a047c
MD5 7b7979f0829726018751da966a6155a6
BLAKE2b-256 e8c7f72a88b268f7b4178df05d720bec53b966fb71073737b8c825a9b543c2f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhttpy-0.3.0-cp312-cp312-manylinux_2_34_x86_64.whl:

Publisher: publish-pypi.yml on genmeta/dhttp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dhttpy-0.3.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dhttpy-0.3.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1a2d94331222a9664b300b6896aaaf4de86355f30ec7be376de59d838a30dbba
MD5 36e02791cba735ef0f3f5fdbcbcf061e
BLAKE2b-256 bac660b3a9b210b2cae939f52a54d11d7ee6fffb6eb46e29765848e7b487653f

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhttpy-0.3.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: publish-pypi.yml on genmeta/dhttp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dhttpy-0.3.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: dhttpy-0.3.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 6.0 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dhttpy-0.3.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f1aacf15fcd17ab22e75d636f1fdbebf63616cff46922c82701c4f6dc85aa0d1
MD5 2cc11647379014200b26c32ef689d2cf
BLAKE2b-256 d5ed7f4f33224821dadbdc22edf761e017ec7ec1f2034391d7b31363dc2cb10b

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhttpy-0.3.0-cp311-cp311-win_amd64.whl:

Publisher: publish-pypi.yml on genmeta/dhttp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dhttpy-0.3.0-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for dhttpy-0.3.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 e8182c600b5e8967a79b87abebed9e34e7f230e493694c69b921a7d372e0b74a
MD5 d65d2a14c77c4bc5945a8cedf74211b4
BLAKE2b-256 464ed82cf2fa6514fd0273a4e3cf5888ec27d49af687713abfb149a90598b77d

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhttpy-0.3.0-cp311-cp311-manylinux_2_34_x86_64.whl:

Publisher: publish-pypi.yml on genmeta/dhttp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dhttpy-0.3.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dhttpy-0.3.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 adfe0d89d144f3169264961ecfd4850a6a4fdaf5533314611119f0031a09d550
MD5 8ad6e4c1553932e261d52d68a84422ca
BLAKE2b-256 aff267cff35892dbb22d6aaad12b0799f221c2325bb2079a036634f8f829d638

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhttpy-0.3.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: publish-pypi.yml on genmeta/dhttp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dhttpy-0.3.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: dhttpy-0.3.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 6.0 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dhttpy-0.3.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 50775369fb05c597a17e7a2b42b405bd615afef94cfd826bafd7619b55f84bfe
MD5 7880894fa6a51081602565fc096750d9
BLAKE2b-256 0141b161d3571e3e1bf99258ff4da3711c48b2e8c4fec92812ea5902d484e926

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhttpy-0.3.0-cp310-cp310-win_amd64.whl:

Publisher: publish-pypi.yml on genmeta/dhttp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dhttpy-0.3.0-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for dhttpy-0.3.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 9910b779f22e72e484beb25411200b1096e9d9e8a70b4a5a6e7d9918eccf7d53
MD5 5d393969e0647b24c0ef532825c070a1
BLAKE2b-256 362390fa0d64c53a40ee64c7acd522371af60d395e7501715899731a8800b5b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhttpy-0.3.0-cp310-cp310-manylinux_2_34_x86_64.whl:

Publisher: publish-pypi.yml on genmeta/dhttp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dhttpy-0.3.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dhttpy-0.3.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0592f1cdbefe4710d1177ea27a0a26afa61f158eb352fa505f4413c5f7bae74c
MD5 a1972298a0b5011c52ad189d91d74d39
BLAKE2b-256 5ade340bc6c337dd7b6a532a48c551f5a5d507439ed11a6bd1d2768530573d77

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhttpy-0.3.0-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: publish-pypi.yml on genmeta/dhttp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page