# Handy-Http Transport [DDoc Reference](ddoc/transport/index.html) Using [Primitives](primitives.md), you can easily define your own request handler, but how does it actually get invoked when a client sends a request? That's where the [Transport](https://git.andrewlalis.com/Handy-Http/transport) component comes in. It provides the HTTP server implementation that listens for requests, turns those into a [`ServerHttpRequest`](ddoc/primitives/handy_http_primitives.request.ServerHttpRequest.html) and [`ServerHttpResponse`](ddoc/primitives/handy_http_primitives.response.ServerHttpResponse.html), and ultimately passes those onto its configured request handler. ## Interface All HTTP transport implementations extend from the top-level [`HttpTransport`](ddoc/transport/handy_http_transport.interfaces.HttpTransport.html) interface, which is defined simply as ```d interface HttpTransport { void start(); void stop(); } ``` A helper method is also provided, [`startInNewThread`](ddoc/transport/handy_http_transport.interfaces.startInNewThread.html), that will take a given `HttpTransport`, spawn a new thread, and call the transport's `start()` method in that thread, to allow you to keep working in the main thread. ## Usage Practically speaking, all production web applications should be served behind some well-trusted reverse proxy like Nginx which handles SSL, so that you only need to use HTTP/1.1 for your own code. To that end, Handy-Http's Transport component provides the [`TaskPoolHttp1Transport`](ddoc/transport/handy_http_transport.http1.task_pool.TaskPoolHttp1Transport.html). ### Task Pool HTTP-1 Transport This transport implementation uses D's standard-library [TaskPool](https://dlang.org/phobos/std_parallelism#.TaskPool) to achieve parallel request processing. When a request is received on the main listening thread, a task is created and passed to the task pool so that a worker thread handles parsing the request, invoking the transport's configured request handler, and ultimately flushing the response back to the client. The [`TaskPoolHttp1Transport`](ddoc/transport/handy_http_transport.http1.task_pool.TaskPoolHttp1Transport.html) takes the following as input via an `Http1TransportConfig` struct in addition to the request handler: * A host to bind to. Defaults to `"127.0.0.1"`. * A port to bind to. Defaults to `8080`. * The number of workers to initialize the task pool with. Defaults to `5`.