V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
naoh1000
V2EX  ›  Rust

请问如何用 Rust 对 API 进行 HTTP2 Push?

  •  
  •   naoh1000 · 2021-02-23 19:34:54 +08:00 via iPhone · 2145 次点击
    这是一个创建于 1129 天前的主题,其中的信息可能已经有所发展或是发生改变。
    找不到任何资料,有了解的 V 友可以讲讲么?
    4 条回复    2021-02-23 23:33:52 +08:00
    fakeshadow
        1
    fakeshadow  
       2021-02-23 20:51:03 +08:00
    试试 h2 这个库
    Hackerchai
        2
    Hackerchai  
       2021-02-23 22:52:00 +08:00   ❤️ 1
    目前来说应该除了 Hyper 这个库都没有实现 HTTP2 Server Push,文档和 issue 没找到,不过在他的底层库 h2 里面找到了实现 [push_request]( https://docs.rs/h2/0.3.0/h2/server/struct.SendResponse.html#method.push_request)

    其他几个主流 web 框架都还没正式实现:
    [actix-web #36]( https://github.com/actix/actix-web/issues/36), [actix-web #150]( https://github.com/actix/actix-web/issues/150), [rocket #177]( https://github.com/SergioBenitez/Rocket/issues/177), [hyper #1586]( https://github.com/hyperium/hyper/issues/1586)
    mxT52CRuqR6o5
        3
    mxT52CRuqR6o5  
       2021-02-23 23:20:49 +08:00 via Android
    SingeeKing
        4
    SingeeKing  
       2021-02-23 23:33:52 +08:00 via iPhone
    http2 push 已经被证明意义不大而逐渐准备废弃了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1137 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 22:52 · PVG 06:52 · LAX 15:52 · JFK 18:52
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.