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

Uploaded CPython 3.13Windows x86-64

dhttpy-0.4.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.4.0-cp313-cp313-macosx_11_0_arm64.whl (6.6 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

dhttpy-0.4.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.4.0-cp312-cp312-macosx_11_0_arm64.whl (6.6 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

dhttpy-0.4.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.4.0-cp311-cp311-macosx_11_0_arm64.whl (6.6 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

dhttpy-0.4.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.4.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.4.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: dhttpy-0.4.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.4.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 cb0f174206d9ed34339128f7d027091a4bcc293d2bf8e0177c60bcade30549df
MD5 a21915cf3b41a5d472d9f030243d2ae3
BLAKE2b-256 d454565d45671f99c3f7c903e5784e5d5446adbea73b94ca87d48a3386e7a114

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dhttpy-0.4.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d36b2b7261b0ac262fbcaa9c10646d5d96a631c658ad0335c8ed7138a038bb43
MD5 999fba5f9d09c670da2184d595fa6692
BLAKE2b-256 2a747df562ba0f0becb908a2b8f8880dbf413ee6451ff4ca293c95431c7ebbaf

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dhttpy-0.4.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5ee4638137409828bca2767e1269a0165a8029967270bbc94aa754772cfa69d4
MD5 567318dc8c026696467c1833c28ebdac
BLAKE2b-256 32a19dda2393c5a50c8ea24eded088c075e8b86e6e360cc4ef1e47700c3b2351

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: dhttpy-0.4.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.4.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 36cf08b69bb44df652ef6d6e208e1e210c9110e9a49b436d53a6519dd1d227ac
MD5 2e1b8f80a8b77f1a192919bc3c3e816b
BLAKE2b-256 f50518ef164300a2f4cf16914536ee5a7b56d809e6cc49c6db8f098fd78569a6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dhttpy-0.4.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 af9c722b97f3c348b523675cb6b68a538332eeb713b8fb1a89cb4ec9ee7d0abc
MD5 d01307ddc1adc7cc1a5cc5199200f909
BLAKE2b-256 1ffd3f30ed95664574f255db421e1e04cfd7d2146c92bb51a8ea2b44a82e6064

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dhttpy-0.4.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 648134880dcd0c2b10a1056d2ad49b9c800477f85e24c4aca6e1eca1d3be0621
MD5 b0347ce4d484cf1288473b8c5532cc88
BLAKE2b-256 c6149a65b5e3c13ceff600bd5a6ae9ade0bb2e24011d607b5a0b630538240e64

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: dhttpy-0.4.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.4.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d534f483943d136e99f6dbfdf537a43eb141c47d7192718e7ce724b9a6a9e893
MD5 b0bd9659069619c83e5d7d2a4565db6f
BLAKE2b-256 1bbaaf451d56c90411b6398aff2fc4676676def1e149a007de4ccc10a2ea5a57

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dhttpy-0.4.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 2f2ec762469aa51ba8be636dc91654605285216dc9f522b026adeb69da9bf4a5
MD5 8a66b58cd719e852d63bd68bfb59280d
BLAKE2b-256 36d59dbfd47cdfd71eee664684285485feeeec42f1e8368631babd453a89a082

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dhttpy-0.4.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 23f24800a059ff456ade228b63a8d0323b17acc8eb2b64682b742782d7512fd1
MD5 daf4f5e8ff75505aea18fafb8ffa1987
BLAKE2b-256 1ba7c672ef9dbdb8d2ea2453720c2109d241ace362e8b01ec96d92451dbfa230

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: dhttpy-0.4.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.4.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 d5588aa37ce71407599de24759af2e5e07eee298611a0a39438adf94bb030488
MD5 72eb85514f96057eb1ead004520bbea3
BLAKE2b-256 2db8eb490aff106a863ec425d922708e7a70983ca1aebfa1c244d3b3de817685

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dhttpy-0.4.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 7d7b4764990ff17d1cbb641bd9e0e741dc6e0bd075768d5379db5a2c98305796
MD5 733cfd4bc62def7cf5c70212d139c6b4
BLAKE2b-256 1761f5c89537222931a31d18b6a0d2521738f3467f25d1024f78f5417ebee8f5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dhttpy-0.4.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 95704c1068a8422f23c2b18c68d5497cd658ea2b0b24ca8b0e7baea069c5c7f4
MD5 0828d8627401403b2e6a93fd94f8ff7c
BLAKE2b-256 6ffbd509fb0fb7b54bbd58eff776e575e71b3b297e0d894e9d0a8dacc928edeb

See more details on using hashes here.

Provenance

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