spdylay 0.2.0 发布,该版本增加一些新的 API:spdylay_gzip API, spdylay_submit_window_update(), spdylay_session_set_option(), and spdylay_strerror(). 增加如下回调函数:spdylay_on_unknown_ctrl_recv_callback and spdylay_on_ctrl_recv_parse_error_callbacks. 已有接口的一些变动. 添加状态码参数:spdylay_on_invalid_ctrl_recv_callback. FRAME_TOO_LARGE 重命名为SPDYLAY_FRAME_TOO_LARGE. spdylay_data_source_read_callback 返回 SPDYLAY_ERR_TEMPORAL_CALLBACK_FAILURE 以示流错误。
spdylay 是 C 语言实现对 SPDY v2/3 协议支持的库
示例代码:
#include <iostream>
#include "spdy.h"
int main()
{
spdy server;
if(!server.listen("localhost", 8080, "server.key", "server.crt",
[](request& req, response& res) {
res.set_status(200);
res.set_header("content-type", "text/plain");
res.end("C++ FTW\n");
}))
return EXIT_FAILURE;
std::cout << "Server running at http://localhost:8080/" << std::endl;
return reactor::run(server);
}
spdylay下载地址请点这里
