Skip to main content

The True Internet

Project description

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.

Project details


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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

dhttpy-0.2.0-cp312-cp312-win_amd64.whl (5.9 MB view details)

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

dhttpy-0.2.0-cp311-cp311-win_amd64.whl (5.9 MB view details)

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

dhttpy-0.2.0-cp310-cp310-win_amd64.whl (5.9 MB view details)

Uploaded CPython 3.10Windows x86-64

dhttpy-0.2.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.2.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.2.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: dhttpy-0.2.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 5.9 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.2.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 3adf658094ef13e894407212066d4330a12bb92f8014118164d34cf06f94edd4
MD5 63a765cdbbbeeb4462ecb6dc0f933310
BLAKE2b-256 7fc51dfcb5322d777d0f22416a1cf24c6f7db715ff2763a86dc9987da1e3629d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dhttpy-0.2.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 1541d07af3d8ffbe3fa4ad224bd25889e71c8a87add76cefccd251a13f279afc
MD5 ea900bf800ba1ae893fa9dabb742dc3d
BLAKE2b-256 02c46fccdaf368d38b99278b945e6d67a04dd54feab40739ffbaa9a81f97fd4b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dhttpy-0.2.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1e6e5cc2e28a7a1d42a566cf3d867f2816406693f7d0d8d8ede828cdccab7ae1
MD5 d8ecad3fe1af5b3939505c58f8da2496
BLAKE2b-256 cdeb70a690ec55e1d8bf0a6dd719fddf7094f0712da4e08ace704b64fa6389b5

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: dhttpy-0.2.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 5.9 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.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 cf7bc97907c4d8144dd7a5d001f90ee7a1ddb4567acc587e8d71f5034a7267e1
MD5 ece1e3b3248692dbcaf11fcbd387c18d
BLAKE2b-256 4145ee17f797126c8e63419a547e63f11bfdcba59530441d6aab7b2f5abbdcf7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dhttpy-0.2.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 602662ee2b42251e1304cc5e1410f86998fb03f1c13f5f93dcd2fbc81cb56326
MD5 582582da0e29d1d3bbf2a71f6e960d74
BLAKE2b-256 e2218a1e0253d787ab8a094e37bb47bc67a29909b1cfcb39666e846e72786286

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dhttpy-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 991edeef7879587fd98546a92bcb9c0d839236883da33e12f859f1f82a5e3b1b
MD5 db550ed69544fc913fb5e4efc560e63a
BLAKE2b-256 638f7800a52e0aa0439851eddbaf8a816b6b64b8d4fa8e208ed88d500222da10

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: dhttpy-0.2.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 5.9 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.2.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f256bf2eb38e562c56df9aff7d8e23df9b824d1f9113d3ad0ae2f660e9c61d67
MD5 0dd147d46bc74c81d4851d5cc58c50ca
BLAKE2b-256 6d3eb98e7d812686c5365ae92e75fbf9593ce3faabc7ef52915c02916f44f77e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dhttpy-0.2.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f09cfc4b844a79980456a0408cf8fe9c9aa4038232af49c9a159a0a87803310f
MD5 8e1930fb11fd499dea69de2bb68c7495
BLAKE2b-256 7bcc23b61871ddd97fd909d0c393d0567a94e44f8d4d2f951dd0a84f43fb75c4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dhttpy-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f3cd2dff209d9af6809d895f09c0f521ea8d2936839c3c93d45c759d211f4735
MD5 b02ad68966f02a9c51405718b55b29cf
BLAKE2b-256 c8d9c750f0babbaed0575aa1056eef854bcd9937660b5fd7d29460f2dd312a1b

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: dhttpy-0.2.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 5.9 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.2.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 d45d438f22fb32ff4ca4d1a2ad9e0a05689d60a7ad987417006fe6dc65c8bd1c
MD5 9f47b80ead2590466fa7c10b7c8ba639
BLAKE2b-256 16f7e998f28b6cf4c9d16ff2655e1d73a4c5249a444e4d0f59128260652c9e06

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dhttpy-0.2.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 e395d98ce02e9e3e5a85411f1fef40d57978effe02c7405aada9a9d5fcff5f46
MD5 bc30dc3968208b827765a0a3903364de
BLAKE2b-256 184d423a4b3be9a6dfa66f0ddc33befaaa6819376f42e539e51ccb4ff78340a2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dhttpy-0.2.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 308c9f5424f9a14b644745950a32cb543ec8f811d8accbc663cb460980234f3c
MD5 0003481663654e4bf888b62aad06c7b4
BLAKE2b-256 0056c49cdfbe97b11aa60acf46311db73bf057ab19fbe1c4513b096c9542f8ab

See more details on using hashes here.

Provenance

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