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.6.0-cp313-cp313-win_amd64.whl (6.1 MB view details)

Uploaded CPython 3.13Windows x86-64

dhttpy-0.6.0-cp313-cp313-manylinux_2_34_x86_64.whl (7.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

dhttpy-0.6.0-cp313-cp313-macosx_11_0_arm64.whl (6.4 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

dhttpy-0.6.0-cp312-cp312-win_amd64.whl (6.1 MB view details)

Uploaded CPython 3.12Windows x86-64

dhttpy-0.6.0-cp312-cp312-manylinux_2_34_x86_64.whl (7.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

dhttpy-0.6.0-cp312-cp312-macosx_11_0_arm64.whl (6.4 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

dhttpy-0.6.0-cp311-cp311-win_amd64.whl (6.1 MB view details)

Uploaded CPython 3.11Windows x86-64

dhttpy-0.6.0-cp311-cp311-manylinux_2_34_x86_64.whl (7.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

dhttpy-0.6.0-cp311-cp311-macosx_11_0_arm64.whl (6.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

dhttpy-0.6.0-cp310-cp310-win_amd64.whl (6.1 MB view details)

Uploaded CPython 3.10Windows x86-64

dhttpy-0.6.0-cp310-cp310-manylinux_2_34_x86_64.whl (7.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

dhttpy-0.6.0-cp310-cp310-macosx_11_0_arm64.whl (6.5 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: dhttpy-0.6.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 6.1 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for dhttpy-0.6.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5344bd82c79ed368595737beff767b6c53fbca1087b7c44d2a7ba1806c4f9908
MD5 dfe9104bd5d5a32f6ceb7ea1ef36f27e
BLAKE2b-256 a9f85ca951ceb494123564f3174f1283ec4e30b588b007ce6b298ceef139a892

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhttpy-0.6.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.6.0-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for dhttpy-0.6.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 024e1656b97fcec55469e88c74f5dfbdecc1897d43ad1cb6c87aee381729c5d5
MD5 a55fd801a7864748599685559931fd11
BLAKE2b-256 71d6b78e6ad4eade240e05c56ffa642308b7b3936e90c26a146b793c031430de

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhttpy-0.6.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.6.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dhttpy-0.6.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cef6fcc4cecdd9f321b0691fa414199330f0e17f6da02c686b9f40218fb14b9a
MD5 acae9e820ad4cee4bd11567c78b1856d
BLAKE2b-256 7d90a9910f12bdd6bcef363f2a959a33c5d994986adcf5d7454d39ab769c415a

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhttpy-0.6.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.6.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: dhttpy-0.6.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 6.1 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for dhttpy-0.6.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ca2d6e3f02d2a060c611bd5c50e5c6ce773b540012b189f3e1fbc62d0d44aec0
MD5 cee672f63b3b6c974c1a4126cb702ecb
BLAKE2b-256 afaa511a20b1d47becce9d0aa6509275fd34ae88192b6ba83135aa2fd0ee59bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhttpy-0.6.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.6.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for dhttpy-0.6.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 200dd27bdea93a2b2af286945ded26e7d193f67e5281212af019373ac93f76eb
MD5 8b0bd93c05f6be8a4adaf7b791e4c275
BLAKE2b-256 b7539f2a6ebbfe8f67fc102d54765dcd7c6b712e4c8e617649dea6fb26386789

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhttpy-0.6.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.6.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dhttpy-0.6.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c7312c87260acab04719b2d80cb2cbaace6543efcac40b8647f2d58dd98dcc98
MD5 4c8437ac22f9103668e94ed451df15bf
BLAKE2b-256 c62f1f166802079b6965965f14beeea398502aad3da07922e6c77254ea086e3f

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhttpy-0.6.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.6.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: dhttpy-0.6.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 6.1 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for dhttpy-0.6.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 55fad0c0f912b4f5847a35837e348afc4b98756d97808a6f160542932133909c
MD5 9909220bd611e82b575da3f52fea42fc
BLAKE2b-256 d6e27b86dfd2004bf9b808a6a29f028a454e4ca947e656177fc57445e8c18988

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhttpy-0.6.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.6.0-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for dhttpy-0.6.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 1deb34eddf53e0e990b7f439724348a15f85aa715135dad958719fa1de7a6d52
MD5 6a5b9e3df44625593031786706807f74
BLAKE2b-256 3d087fc6ae0ae26bccb5f6569b6090a74426756fa661d093989cd7a5a0ebcc42

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhttpy-0.6.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.6.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dhttpy-0.6.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7a2917060934afd7f1c057c8dd1fffe80228518d72ae7e3c8e6db3d6739d30da
MD5 b180a6b0f0a1a136a8852a39e271d448
BLAKE2b-256 3e2af29607ac8bba877e600568e05f83f57952993239b0f585fafa27f68cbced

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhttpy-0.6.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.6.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: dhttpy-0.6.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 6.1 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for dhttpy-0.6.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 804e820f7bb103e723b6c89664e0b42a30a19627ec24887c8f96c51e16675828
MD5 2edffa8332780fc47c29d2b920feae98
BLAKE2b-256 261250a0c8f191bc876ad9bb6ea3109505a25865a13b0b29c23d7455904ba27f

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhttpy-0.6.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.6.0-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for dhttpy-0.6.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 bcef739a711a8af613103e89bbd99239ce5f88c4cb1173d087fe0ca41b2d36b9
MD5 3e0fa698902d6d517b2ae42d4ded6a03
BLAKE2b-256 94a3c1ea40eaab699ccabc665b5445ee57129c24b7fe7ef7163bb526be9bc9c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhttpy-0.6.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.6.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dhttpy-0.6.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 87a8aba27c19994b9e1c63a397884a8c8720545d19541aab975ef2d3f932c7af
MD5 ac96a450f55ad84c491868abb3b7a192
BLAKE2b-256 a721e6899b6a256084d5a327f56a0a05ea7df5b741e806b3ea4ab49d6ea819c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhttpy-0.6.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