Conduit

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

 port

       port => $int

    TCP port number to listen on for HTTP requests.

    Either this or the listensock parameter must be provided; though the
    latter is intended for internal and unit-test purposes and will not be
    otherwise documented.

 responder

       responder => $app
    
          $response = await $app->( $request );

    A code reference to the responder used for handling requests.

    It will be passed an HTTP::Request instance containing the incoming
    request and is expected to yield an HTTP::Response instance via a
    future. As a small convenience, the server will fill in the protocol
    and content_length fields of the response if they are not provided by
    the responder.

 psgi_app

       psgi_app => $app

    A code reference to the PSGI application used for handling requests.

    Currently, exactly one of responder or psgi_app must be provided, but
    the intention is soon to allow other forms of responders, such as PAGI
    as alternatives.

METHODS

 run

       $run_f = $conduit->run;

    Starts operation of the server, allowing it to accept new connections,
    serve requests, and run the application.

    Returns a Future instance that in normal circumstances should never
    complete; it will remain pending indefinitely. The toplevel program can
    either await this if it has nothing else to do, or add that to a
    collection such as with Future::Selector.

TODO

    Honestly, quite a lot. Almost everything in fact. ;)

      * PAGI support; likely in preference to any more PSGI.

      * Maybe support streaming PSGI responses, though it would still be
      preferrable to do this with PAGI first.

      * Investigate split IPv4+IPv6 serving, whether it needs two socket or
      one will suffice. This may be OS-dependent.

      * HTTPS, perhaps via IO::Socket::SSL or maybe something newer?

      * Look into what's required to support some sort of websocket thing
      in addition to plain HTTP.

AUTHOR

    Paul Evans <leonerd@leonerd.org.uk>



( run in 1.368 second using v1.01-cache-2.11-cpan-39bf76dae61 )