- 授权协议: MIT
- 开发语言: C/C++
- 操作系统: 跨平台
- 软件首页: https://github.com/joyent/http-parser
- 软件文档: https://github.com/joyent/http-parser
- 官方下载: https://github.com/joyent/http-parser
软件介绍
C语言实现的HTTP解析器,提供请求和响应报文的解析功能,可用于高性能的HTTP应用程序中。它不使用任何系统调用及内存分配的功能,并且不缓冲任何数据,可以被随时中断使用。根据你的系统架构,它处理一个请求只消耗约40字节(而对于网络服务器就是每个连接)。
功能:
- 不依赖第三方库
- 处理持续流(keep-alive)
- 分块解码
- 支持Upgrade
- 防止缓冲区溢出攻击
可以从HTTP消息中解析出下列信息:
- 报头域及值
- Content-Length
- 请求方法
- 响应代码
- 传输编码
- HTTP版本
- 请求URL
- 消息体
示例代码:
http_parser_settings settings; settings.on_url = my_url_callback; settings.on_header_field = my_header_field_callback; /* ... */ http_parser *parser = malloc(sizeof(http_parser)); http_parser_init(parser, HTTP_REQUEST); parser->data = my_socket;
Effective JavaScript
David Herman / Addison-Wesley Professional / 2012-12-6 / USD 39.99
"It's uncommon to have a programming language wonk who can speak in such comfortable and friendly language as David does. His walk through the syntax and semantics of JavaScript is both charming and h......一起来看看 《Effective JavaScript》 这本书的介绍吧!
