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

Uploaded CPython 3.13Windows x86-64

dhttpy-0.1.0-cp313-cp313-manylinux_2_34_x86_64.whl (7.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

dhttpy-0.1.0-cp313-cp313-macosx_11_0_arm64.whl (6.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

dhttpy-0.1.0-cp312-cp312-win_amd64.whl (6.2 MB view details)

Uploaded CPython 3.12Windows x86-64

dhttpy-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl (7.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

dhttpy-0.1.0-cp312-cp312-macosx_11_0_arm64.whl (6.8 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

dhttpy-0.1.0-cp311-cp311-win_amd64.whl (6.2 MB view details)

Uploaded CPython 3.11Windows x86-64

dhttpy-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl (7.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

dhttpy-0.1.0-cp311-cp311-macosx_11_0_arm64.whl (6.8 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

dhttpy-0.1.0-cp310-cp310-win_amd64.whl (6.2 MB view details)

Uploaded CPython 3.10Windows x86-64

dhttpy-0.1.0-cp310-cp310-manylinux_2_34_x86_64.whl (7.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

dhttpy-0.1.0-cp310-cp310-macosx_11_0_arm64.whl (6.8 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: dhttpy-0.1.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 6.2 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.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 d250a388ffd2eb730d8d2eba871c83c1422d1cb1d7de251853aa5f24b56675c2
MD5 4d17bd53c81ec87bf2bab1941deb131f
BLAKE2b-256 cdada33f34cabd0910e33192fc2a26e9075b81f96753a3a3ef2166bf516345a1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dhttpy-0.1.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 5a42606b214cf517bbc65306bb7be3de8cffd9f89fa59dc8f740f9d0f46c7628
MD5 8974e4ff0e4662110f576d6e8c3dda7d
BLAKE2b-256 b4f4bc595f9cade62ec97666cfa008d42bfd4116ba05ad58f047a7ee0e412e38

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dhttpy-0.1.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3cc321f0b54bf0ff7c7d1e86f93ea7f19f5362683cabd9934c00e70bfb3d8060
MD5 d2124374a8b5080bd4d5f7d01b7be4f6
BLAKE2b-256 9abe8f4744b985085b677146825d092fc5a21ccd389a0c201807dbd42d206cde

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: dhttpy-0.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 6.2 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.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 48799575a95b51933a99ad21a5939e957176b23b7f03cf827044b0593b07604f
MD5 b242ceebd041c44922d5a1beb32cc012
BLAKE2b-256 4a22c18f11cbb01511bd03b31a1257779fbcfebad7235f01afb23e3f6c2cefe2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dhttpy-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 471758afd05b285e85268087960b6326ba76f9a3e6a2681d57b71737f304c24b
MD5 5c21062d0980dbeefdcb075928c4b1e6
BLAKE2b-256 3cc480a30f29b373f9b13625bf8d2cc72bc85d251b129f23b37ab1298c1eea73

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dhttpy-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 93b4afce161bd85a193ee0c367529c10df44ba21b79ae94ef3593a58a9358e61
MD5 ec06b67fee473c6cb4d7ea4049965be9
BLAKE2b-256 1f17c4e44e42982108b91e03630f9aff09e9092cd0db5e6f93782d88de9e907f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: dhttpy-0.1.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 6.2 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.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6a72730784d854ddac5fb71fa612a887b9c45b0e219fe87b01d78cef8d5db13b
MD5 6698a80f83dd49cc877a08e406e01753
BLAKE2b-256 79b1bee8ddf09de4a1fbba282091a4215c58a98a001d0a1739040e397077c0d3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dhttpy-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c34accc526ae4c8deb64d73f45782871e565d11c6007587bd411a160ad812839
MD5 cc9d718b9c909bde5a1ce2daeb79b27e
BLAKE2b-256 dc235a2a0a93131f14ee75da2af5b8b7839c78773ad04e0e077d47edcc48b7a9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dhttpy-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9b3632de4119a88fbe6efed21aa043e5d43db7a35282f8d4f18ac70c699fec4f
MD5 e7d7ce8851a04270a481364bc5572ad3
BLAKE2b-256 dbe8c9e2cb1f1d37911fe0832a4d4d5ce8ef93edd4de8b5396d165bccf928393

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: dhttpy-0.1.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 6.2 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.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 ebd87cc3d9d6163658bb29de1b4a0674b30def15fca7fddd34dbd388fe293d74
MD5 b7612c48b94747aab82bce8c6ce08054
BLAKE2b-256 ddf38d20263911da6d1762f2c1332733f6d019c56482b3757eff727659701ea4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dhttpy-0.1.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 50ace29a26fb6346185a2cf585b77918975bc89880f7610c450d08000dbbf848
MD5 0d409f35667bfeba2419ede4bd730449
BLAKE2b-256 f481f0635df732af7827b4c3153c36dd64dbe76c47386af7dfcf5de0f295ccc9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dhttpy-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 940c3db24d148fb046c6c56656d7ac0aefb72c62bc2f8af7debb71e8376fa4c9
MD5 67b86b30a1855bf1feb0440203789acb
BLAKE2b-256 6a3fa115cceb190c046c8a1a2cf21884855a489210ffaefc66b906988774631c

See more details on using hashes here.

Provenance

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