使用c ++,openssl的APNs Provider API HTTP / 2

时间:2016-04-26 06:08:25

标签: c++

我尝试用HPACK发送标题帧和数据帧,然后我从APNS收到了COMPRESSION_ERROR(0x9)的分离帧。

我的步骤:

  1. 发送设置框架
  2. recv设置框架
  3. 发送确认
  4. recv ACK
  5. 发送标题框
  6. 发送数据框
  7. requset:

    HEADERS
      - END_STREAM
      + END_HEADERS
      :method = POST
      :scheme = https
      :path = /3/device/ad92823c9e42e37241b6cdf6f583c6cdf5dcc21289c57fb6641213abeff8095d
      host = api.development.push.apple.com
    DATA
      + END_STREAM
      { "aps" : { "alert" : "Hello" } }
    

    十六进制:

    00 00 77 01 04 00 00 00 01     HEADER FRAME
    83                             :method = POST
    86                             :scheme = https
    04                             :path =   (Literal Header Field without Indexing)
    4a                             length(74)
    2f 33 2f 64 65 76 69 63        /3/device/ad92823c9e42e37241b6cdf6f583c6cdf5dcc21289c57fb6641213abeff8095d
    65 2f 61 64 39 32 38 32 
    33 63 39 65 34 32 65 33 
    37 32 34 31 62 36 63 64 
    66 36 66 35 38 33 63 36 
    63 64 66 35 64 63 63 32 
    31 32 38 39 63 35 37 66 
    62 36 36 34 31 32 31 33 
    61 62 65 66 66 38 30 39 
    35 64 
    66                              host =  
    1e                              length(30)
    61 70 69 2e 64 65 76 65         api.development.psuh.apple.com 
    6c 6f 70 6d 65 6e 74 2e
    70 75 73 68 2e 61 70 70
    6c 65 2e 63 6f 6d
    
    00 00 21 00 01 00 00 00 01      DATA FRAME
    7b 20 22 61 70 73 22 20         { "aps" : { "alert" : "hello" } }
    3a 20 7b 20 22 61 6c 65 
    72 74 22 20 3a 20 22 68 
    65 6c 6c 6f 22 20 7d 20 
    7d
    

    任何提示? 感谢

0 个答案:

没有答案