| 1 |
# NAME |
| 2 |
|
| 3 |
Protocol::HTTP2 - HTTP/2 protocol implementation (RFC 7540) |
| 4 |
|
| 5 |
# SYNOPSIS |
| 6 |
|
| 7 |
use Protocol::HTTP2; |
| 8 |
|
| 9 |
# get protocol identification string for secure connections |
| 10 |
print Protocol::HTTP2::ident_tls; # h2 |
| 11 |
|
| 12 |
# get protocol identification string for non-secure connections |
| 13 |
print Protocol::HTTP2::ident_plain; # h2c |
| 14 |
|
| 15 |
# DESCRIPTION |
| 16 |
|
| 17 |
Protocol::HTTP2 is HTTP/2 protocol implementation ([RFC 7540](https://tools.ietf.org/html/rfc7540)) with stateful |
| 18 |
decoders/encoders of HTTP/2 frames. You may use this module to implement your |
| 19 |
own HTTP/2 client/server/intermediate on top of your favorite event loop over |
| 20 |
plain or tls socket (see examples). |
| 21 |
|
| 22 |
# STATUS |
| 23 |
|
| 24 |
Current status - beta. Structures, module names and methods seems like stable. |
| 25 |
I've started this project to understand internals of HTTP/2 and may be it will |
| 26 |
never become production, but at least it works. |
| 27 |
|
| 28 |
| Spec | status | |
| 29 |
| ----------------------- | --------------- | |
| 30 |
| Negotiation | ALPN, NPN, | |
| 31 |
| | Upgrade, direct | |
| 32 |
| Preface | + | |
| 33 |
| Headers (de)compression | + | |
| 34 |
| Stream states | + | |
| 35 |
| Flow control | ± | |
| 36 |
| Stream priority | ± | |
| 37 |
| Server push | + | |
| 38 |
| Connect method | - | |
| 39 |
|
| 40 |
|
| 41 |
| Frame | encoder | decoder | |
| 42 |
| --------------- |:-------:|:-------:| |
| 43 |
| DATA | ± | + | |
| 44 |
| HEADERS | + | + | |
| 45 |
| PRIORITY | + | + | |
| 46 |
| RST_STREAM | + | + | |
| 47 |
| SETTINGS | + | + | |
| 48 |
| PUSH_PROMISE | + | + | |
| 49 |
| PING | + | + | |
| 50 |
| GOAWAY | + | + | |
| 51 |
| WINDOW_UPDATE | + | + | |
| 52 |
| CONTINUATION | ± | + | |
| 53 |
|
| 54 |
- - -- not implemented |
| 55 |
- ± -- incomplete |
| 56 |
- + -- implemented (may even work) |
| 57 |
|
| 58 |
# MODULES |
| 59 |
|
| 60 |
## [Protocol::HTTP2::Client](https://metacpan.org/pod/Protocol%3A%3AHTTP2%3A%3AClient) |
| 61 |
|
| 62 |
Client protocol decoder/encoder with constructor of requests |
| 63 |
|
| 64 |
## [Protocol::HTTP2::Server](https://metacpan.org/pod/Protocol%3A%3AHTTP2%3A%3AServer) |
| 65 |
|
| 66 |
Server protocol decoder/encoder with constructor of responses/pushes |
| 67 |
|
| 68 |
## [Protocol::HTTP2::Connection](https://metacpan.org/pod/Protocol%3A%3AHTTP2%3A%3AConnection) |
| 69 |
|
| 70 |
Main low level module for protocol logic and state processing. Connection |
| 71 |
object is a mixin of [Protocol::HTTP2::Frame](https://metacpan.org/pod/Protocol%3A%3AHTTP2%3A%3AFrame) (frame encoding/decoding), |
| 72 |
[Protocol::HTTP2::Stream](https://metacpan.org/pod/Protocol%3A%3AHTTP2%3A%3AStream) (stream operations) and [Protocol::HTTP2::Upgrade](https://metacpan.org/pod/Protocol%3A%3AHTTP2%3A%3AUpgrade) |
| 73 |
(HTTP/1.1 Upgrade support) |
| 74 |
|
| 75 |
## [Protocol::HTTP2::HeaderCompression](https://metacpan.org/pod/Protocol%3A%3AHTTP2%3A%3AHeaderCompression) |
| 76 |
|
| 77 |
Module implements HPACK - Header Compression for HTTP/2 ([RFC 7541](https://tools.ietf.org/html/rfc7541)). |
| 78 |
|
| 79 |
## [Protocol::HTTP2::Constants](https://metacpan.org/pod/Protocol%3A%3AHTTP2%3A%3AConstants) |
| 80 |
|
| 81 |
Module contains all defined in HTTP/2 protocol constants and default values |
| 82 |
|
| 83 |
## [Protocol::HTTP2::Trace](https://metacpan.org/pod/Protocol%3A%3AHTTP2%3A%3ATrace) |
| 84 |
|
| 85 |
Module for debugging. You can setup HTTP2\_DEBUG environment variable to change |
| 86 |
verbosity of the module (output to STDOUT). Default level is error. |
| 87 |
|
| 88 |
$ export HTTP2_DEBUG=debug |
| 89 |
$ perl ./http2_program |
| 90 |
|
| 91 |
# SEE ALSO |
| 92 |
|
| 93 |
[https://github.com/vlet/p5-Protocol-HTTP2/wiki](https://github.com/vlet/p5-Protocol-HTTP2/wiki) - Protocol::HTTP2 wiki |
| 94 |
|
| 95 |
[http://http2.github.io/](http://http2.github.io/) - official HTTP/2 specification site |
| 96 |
|
| 97 |
[http://daniel.haxx.se/http2/](http://daniel.haxx.se/http2/) - http2 explained |
| 98 |
|
| 99 |
# LICENSE |
| 100 |
|
| 101 |
Copyright (C) Vladimir Lettiev. |
| 102 |
|
| 103 |
This library is free software; you can redistribute it and/or modify |
| 104 |
it under the same terms as Perl itself. |
| 105 |
|
| 106 |
# AUTHOR |
| 107 |
|
| 108 |
Vladimir Lettiev <[email protected]> |