Implementations of HTTP transport protocols, compatible with other Handy-Http components.
Go to file
Andrew Lalis 7ff80c8a9f
Build and Test Module / build-and-test (push) Successful in 11s Details
Build and Test Module / integration-tests (push) Successful in 19s Details
Update license to MIT-0.
2025-08-09 21:45:37 -04:00
.gitea/workflows Added tests. 2025-06-29 11:42:36 -04:00
integration-tests Added integration tests, simpler implementation which uses task pool. 2025-06-29 15:06:14 -04:00
source/handy_http_transport Added separate config for http1transport. 2025-08-09 21:44:16 -04:00
.gitignore Added working HTTP/1.1 transport implementation. 2024-11-14 14:51:23 -05:00
LICENSE Update license to MIT-0. 2025-08-09 21:45:37 -04:00
README.md Added separate config for http1transport. 2025-08-09 21:44:16 -04:00
dub.json Upgrade primitives 2025-07-05 22:06:56 -04:00
dub.selections.json Upgrade primitives 2025-07-05 22:06:56 -04:00

README.md

http-transport

This library provides implementations of various versions of HTTP transport, acting as a "glue" for connecting clients and servers. Practically speaking, the handy-http-transport library provides HTTP server implementations you can use interchangeably with other handy-http libraries.

For now, see the section on HTTP/1.1, as that's the only HTTP version implemented so far.

HTTP/1.1

Use the TaskPoolHttp1Transport implementation of HttpTransport to serve content using the HTTP/1.1 protocol. See the example below:

import handy_http_primitives;
import handy_http_transport;

class MyHandler : HttpRequestHandler {
    void handle(ref ServerHttpRequest req, ref Server HttpResponse resp) {
        response.status = HttpStatus.OK;
        response.headers.add("Content-Type", "text/plain");
        response.outputStream.writeToStream(cast(ubyte[]) "Hello world!");
    }
}

void main() {
    HttpTransport tp = new TaskPoolHttp1Transport(new MyHandler());
    tp.start();
}