diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2015-05-27 09:30:52 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2015-05-27 09:30:52 +1200 |
commit | 3f25df0b122c08ff3c14f2e95a905905028793aa (patch) | |
tree | 12619392fb75ff112945168991f38f017a6904a9 /netlib/h2/h2.py | |
parent | ae749975e537990f3db767b4d0d4c6ec2321a088 (diff) | |
parent | 4ce6f43616db9c23a29484610045aecd88ed2cfc (diff) | |
download | mitmproxy-3f25df0b122c08ff3c14f2e95a905905028793aa.tar.gz mitmproxy-3f25df0b122c08ff3c14f2e95a905905028793aa.tar.bz2 mitmproxy-3f25df0b122c08ff3c14f2e95a905905028793aa.zip |
Merge pull request #56 from Kriechi/http2-frames
implement basic HTTP/2 frame classes
Diffstat (limited to 'netlib/h2/h2.py')
-rw-r--r-- | netlib/h2/h2.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/netlib/h2/h2.py b/netlib/h2/h2.py new file mode 100644 index 00000000..5d74c1c8 --- /dev/null +++ b/netlib/h2/h2.py @@ -0,0 +1,25 @@ +import base64 +import hashlib +import os +import struct +import io + +# "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" +CLIENT_CONNECTION_PREFACE = '505249202a20485454502f322e300d0a0d0a534d0d0a0d0a' + +ERROR_CODES = utils.BiDi( + NO_ERROR = 0x0, + PROTOCOL_ERROR = 0x1, + INTERNAL_ERROR = 0x2, + FLOW_CONTROL_ERROR = 0x3, + SETTINGS_TIMEOUT = 0x4, + STREAM_CLOSED = 0x5, + FRAME_SIZE_ERROR = 0x6, + REFUSED_STREAM = 0x7, + CANCEL = 0x8, + COMPRESSION_ERROR = 0x9, + CONNECT_ERROR = 0xa, + ENHANCE_YOUR_CALM = 0xb, + INADEQUATE_SECURITY = 0xc, + HTTP_1_1_REQUIRED = 0xd + ) |