Implementations of HTTP transport protocols, compatible with other Handy-Http components.
Go to file
Andrew Lalis 5d42fa7f83 Cleaned up main http1.1 module. 2025-01-09 22:26:09 -05:00
source/handy_http_transport Cleaned up main http1.1 module. 2025-01-09 22:26:09 -05:00
.gitignore Added working HTTP/1.1 transport implementation. 2024-11-14 14:51:23 -05:00
LICENSE Changed to CC0 license, added work-in-progress code for HTTP/1 2024-10-22 14:56:28 -04:00
README.md Added some content to the readme. 2025-01-09 21:58:32 -05:00
dub.json Added photon, tagged version of primitives, and some server logic cleanup. 2025-01-09 21:52:11 -05:00
dub.selections.json Added photon, tagged version of primitives, and some server logic cleanup. 2025-01-09 21:52:11 -05:00

README.md

http-transport

Implementations of HTTP transport protocols, compatible with other Handy-Http components.

HTTP/1.1

Use the Http1Transport 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 Http1Transport(new MyHandler(), 8080);
    tp.start();
}