Perl の HTTP/2 事情 / HTTP2 in Perl

Bca2e4847cad171859e093aaf88a6c22?s=47 zoncoen
December 09, 2015

Perl の HTTP/2 事情 / HTTP2 in Perl

Gotanda.pm #4 http://gotanda-pm.connpass.com/event/11993/ の発表資料です

Bca2e4847cad171859e093aaf88a6c22?s=128

zoncoen

December 09, 2015
Tweet

Transcript

  1. 2.

    HTTP/2 • HTTP/2 Approved | IETF Blog • ΋͏͙͢ RFC

    ͕ൃߦ͞ΕΔ • ͢Ͱʹ30Ҏ্ͷ࣮૷͕͋Δ • Implementations · http2/http2-spec Wiki
  2. 4.

    Protocol::HTTP2 # Prepare http/2 request $client->request( ':scheme' => "http", ':authority'

    => $host . ":" . $port, ':path' => "/hello", ':method' => "GET", headers => [ 'accept' => '*/*', 'user-agent' => 'perl-Protocol-HTTP2/0.01', ], on_done => sub { my ( $headers, $data ) = @_; printf "Get headers. Count: %i\n", scalar(@$headers) / 2; printf "Get data. Length: %i\n", length($data); print $data; }, ); • Connect ͸ AnyEvent Ͱΰχϣΰχϣ΍Δ
  3. 5.

    Protocol::HTTP2 • request -> request ͰฒྻϦΫΤετ $client->request( ':scheme' => "http",

    ':authority' => $host . ":" . $port, ':path' => "/minil.toml", ':method' => "GET", headers => [ 'accept' => '*/*', 'user-agent' => 'perl-Protocol-HTTP2/0.01', ], on_done => sub { my ( $headers, $data ) = @_; printf "Get headers. Count: %i\n", scalar(@$headers) / 2; printf "Get data. Length: %i\n", length($data); print $data; }, )->request( … );
  4. 8.
  5. 9.
  6. 10.
  7. 11.