࣮ࡍʹࢼͯ͠ΈΔ $ perl no_tls_server_multistream.pl $ perl no_tls_client_multistream.pl Stream 1 changed state from IDLE to HALF_CLOSED Stream 3 changed state from IDLE to HALF_CLOSED Stream 3 changed state from HALF_CLOSED to CLOSED [ [ ":status", "200", "server", "perl-Protocol-HTTP2/1.08", "content-length", "13" ] ] Stream 1 changed state from HALF_CLOSED to CLOSED [ [ ":status", "200", "server", "perl-Protocol-HTTP2/1.08", "content-length", "102400" ] ]
αʔόʔϓογϡͷड৴ my $client = Protocol::HTTP2::Client->new( on_push => sub { my ($push_headers) = @_; print "Server want to push some resource to us\n”; return sub { my ($headers, $data) = @_; print "Received promised resource\n"; }; }, on_change_state => sub { }, on_error => sub { }, );
࣮ࡍʹࢼͯ͠ΈΔ $ perl tls_client_server_push.pl Stream 1 changed state from IDLE to HALF_CLOSED Stream 2 changed state from IDLE to RESERVED Server want to push some resource to us Stream 1 changed state from HALF_CLOSED to CLOSED [ [ தུ ], "\n \n HTTP/2 Server Push Test\n \n \n \n Server Push Test\n \n" ] Stream 2 changed state from RESERVED to HALF_CLOSED Stream 2 changed state from HALF_CLOSED to CLOSED Received promised resource $VAR1 = [ [ ':status', '200', 'server', 'perl-Protocol-HTTP2/1.08', 'content-length', '26', 'content-type', 'text/css' ], '.push { color: red; } ' ];