为什么小便会带血| 为什么怀孕了就不来月经了| 为什么会长胎记| 吃什么提神醒脑抗疲劳| 为什么一喝酒就拉肚子| 病理会诊是什么意思| 阴囊是什么| 屈光检查是什么| 眼睛不好吃什么补眼睛| 强迫症什么意思| 血小板分布宽度偏低是什么意思| 一什么绿毯| 失重感是什么感觉| 大拇指脱皮是什么原因| pr是什么工作| alex是什么意思| poems是什么意思| 血红蛋白浓度是什么意思| 吗丁啉是什么药| 人生什么最重要| 臃肿是什么意思| 哮喘吃什么药好| 喝老陈皮水有什么好处| 一什么心| 一个火一个日一个立念什么| 去湿气吃什么食物好| 中国反导弹系统叫什么| 梦见蛇追我是什么预兆| 09年属什么生肖| 喜鹊进家有什么预兆| 阴虚血热什么症状| 梦见两条大蟒蛇是什么征兆| 贴图是什么意思| 直肠ca是什么意思| 什么是t| 属兔适合佩戴什么饰品| 风平浪静是什么生肖| 盐是什么| wis是什么牌子| 地中海贫血什么意思| 男人阳气不足有什么症状| 吃什么养肾| 补脾吃什么食物最好| 僵尸为什么怕糯米| 沙加女是什么字| 草鱼又叫什么鱼| 四书五经是什么| 肠穿孔有什么症状| 鹿晗女朋友叫什么名字| 什么药治灰指甲最有效| 9.3号是什么星座| en是什么意思| 婴儿头发竖起来是什么原因| 黔鱼是什么鱼| 王不留行是什么| 褒义词是什么意思| ercp是什么检查| 在什么地方| 牛骨头炖什么好吃| o型血与a型血生的孩子是什么血型| 用醋泡脚有什么好处| 锅包肉用什么淀粉| 六月初三是什么星座| 姨妈安全期是什么时候| cba是什么| 红细胞数目偏高是什么意思| gaba是什么| 强的松是什么药| 总动员是什么意思| 莲子心泡水喝有什么功效和作用| 幻听是什么原因| 吃什么提高免疫力和增强体质| 图注是什么| 8月19号是什么星座| 什么是人生| 回绝是什么意思| 肚子肥胖是什么原因引起的| 乙酰氨基酚片是什么药| 圆明园是什么时候被烧的| 血糖在化验单上叫什么| n t是什么检查| 大腿根部内侧瘙痒用什么药膏| 椭圆机是什么| 圣女果是什么| 油漆味对人有什么危害| 路由器管理员密码是什么| 鹰嘴桃什么时候成熟| 胃疼喝什么可以缓解| 喝蜂蜜水有什么好处| 绿豆不能和什么一起吃| hape是什么牌子| 赶集什么意思| 做腹部彩超挂什么科| 餐边柜放什么东西| 转什么为什么成语| 血脂高吃什么水果| 泡脚时间长了有什么坏处| 鱼油功效和作用是什么| 扁平疣是什么样子图片| 豆干炒什么好吃| 心外科是看什么病的| 苦荞有什么作用| 笑话是什么意思| 天天都需要你爱是什么歌| 身上长红色的痣是什么原因| 天衣无缝什么意思| 小布丁是什么意思| 什么叫风湿| 胃气上逆有什么好的办法治疗| 氟是什么东西| 梵天是什么意思| 正法是什么意思| 发烧是什么感觉| 宝宝反复发烧是什么原因| 小叶增生和乳腺增生有什么区别| 炎症是什么原因引起的| 熬夜为什么会胖| 处女座什么性格| 94年属于什么生肖| 坤位是什么方向| 封面是什么意思| 叶绿素是什么| 老花眼视力模糊有什么办法解决吗| 抗原和抗体有什么区别| 太阳穴疼痛是什么原因| 本是同根生相煎何太急是什么意思| 风湿挂什么科| 拍身份证照片穿什么颜色衣服好看| apc药片是什么药| 肚子上方中间疼是什么部位| 病人是什么生肖| 脸颊两边长斑是什么原因| 牛油果对身体有什么好处| 好奇害死猫是什么意思| 芥蒂是什么意思| 25岁今年属什么生肖| 胎儿宫内窘迫是什么意思| 星期天左眼皮跳是什么预兆| 为什么人死后要盖住脸| 杆菌一个加号什么意思| 河北有什么山| 肾上腺结节挂什么科| 女人吃黄芪有什么好处| 姜黄是什么东西| 混油皮是什么意思| 人生最重要的是什么| 什么年树木| 近视散光是什么意思| 人为什么会死| 老是干咳嗽是什么原因| 千娇百媚是什么意思| 院士是什么学位| cd代表什么意思| 熬是什么意思| 阴唇内侧长疙瘩是什么原因| 人为什么会抑郁| 辅酶q10什么时候吃最好| 厕所里应该摆什么花| 太瘦的人吃什么能长胖| 胃炎吃什么好| 6月2日是什么星座| 甲状腺结节吃什么好| 站点是什么意思| 病毒性咽喉炎吃什么药| 全麦粉是什么面粉| 冢字的意思是什么| 南瓜炒什么好吃| 水代表什么数字| 食是什么生肖| 月经前几天是什么期| 孕妇吃什么牌子奶粉| 二氧化碳是什么气体| 梦见长白头发是什么意思| 单身贵族什么意思| 霍金什么时候去世的| 居高临下的临是什么意思| 烟花三月下扬州什么意思| 什么是直流电| 犒赏是什么意思| 月子早餐吃什么好| 鸡蛋炒什么| 大腿根部疼痛是什么原因| 臻的意思是什么| 铁饱和度低什么原因| 客家人为什么叫客家人| 怀孕初期应该注意什么| 9527是什么意思| 间接胆红素高是什么原因| 头颅mri是什么检查| 肝火胃火旺吃什么药| 喝什么助眠| 双日是什么意思| 水鱼是什么| 肾上腺素是什么意思| 气口是什么意思| dunk是什么牌子| 樱桃红是什么颜色| 肆意是什么意思| 屁眼疼是什么原因| dce是什么溶剂| 颈椎疼挂什么科| 白细胞加号什么意思| 学架子鼓有什么好处| 慢性咽喉炎吃什么药| 外感风热是什么意思| 双侧骶髂关节致密性骨炎是什么病| 一什么教室| 麻叶是什么植物| 感冒为什么会全身酸痛无力| 仕途是什么意思| 什么是直男| 单飞什么意思| 桦树茸有什么功效| 画画可以画什么| 鼻子两侧毛孔粗大是什么原因造成的| 两女一杯什么意思| 黄精什么功效| 潜能什么意思| 94狗跟什么属相配最好| 十月份是什么季节| 竹子可以做什么| 7月13日是什么日子| mep是什么意思| 血蛋白低是什么原因| ct查什么| 1941年是什么年| 头疼做什么检查| 陌陌是干什么的| 为什么要穿内裤| 拉不出尿是什么原因| 无病呻吟是什么意思| 公积金有什么作用| 什么是碱性水| saucony是什么牌子| 什么东西清肺止咳| 小动脉瘤是什么意思| e是什么牌子| 眼睛疼滴什么眼药水| 畸形是什么意思| 做月子要注意什么| 蓝色和红色混合是什么颜色| 小孩吃什么提高免疫力| 血钾高是什么引起的| 红糖的原料是什么| 石油是什么意思| 白细胞偏低是什么原因| 胸口闷是什么原因| 圆圆的什么| 什么穿针大眼瞪小眼| 鼻涕倒流吃什么药| 白色病变是什么病| 吃虾不能吃什么| 空腹血糖受损是什么意思| 乙肝抗体是什么意思| 香蕉可以做什么美食| 9d是什么意思| 吃你鲍鱼是什么意思| acer是什么牌子| 尿检3个加号什么意思| 腹腔肠系膜淋巴结是什么病| 什么叫开门见床头| 头发的主要成分是什么| 鸡同鸭讲是什么意思| 属猴的和什么属相最配| 百度
Skip to content

molnarg/node-http2

Repository files navigation

node-http2

An HTTP/2 (RFC 7540) client and server implementation for node.js.

Travis CI status

NOTE WELL This package is officially deprecated. As of node 9.0.0, there is an 'http2' package built-in. You should use that one instead.

Installation

npm install http2

API

The API is very similar to the standard node.js HTTPS API. The goal is the perfect API compatibility, with additional HTTP2 related extensions (like server push).

Detailed API documentation is primarily maintained in the lib/http.js file and is available in the wiki as well.

Examples

Using as a server

var options = {
  key: fs.readFileSync('./example/localhost.key'),
  cert: fs.readFileSync('./example/localhost.crt')
};

require('http2').createServer(options, function(request, response) {
  response.end('Hello world!');
}).listen(8080);

Using as a client

require('http2').get('http://localhost:8080/', function(response) {
  response.pipe(process.stdout);
});

Simple static file server

An simple static file server serving up content from its own directory is available in the example directory. Running the server:

$ node ./example/server.js

Simple command line client

An example client is also available. Downloading the server's own source code from the server:

$ node ./example/client.js 'http://localhost:8080/server.js' >/tmp/server.js

Server push

For a server push example, see the source code of the example server and client.

Status

  • ALPN is only supported in node.js >= 5.0
  • Upgrade mechanism to start HTTP/2 over unencrypted channel is not implemented yet (issue #4)
  • Other minor features found in this list are not implemented yet

Development

Development dependencies

There's a few library you will need to have installed to do anything described in the following sections. After installing/cloning node-http2, run npm install in its directory to install development dependencies.

Used libraries:

For pretty printing logs, you will also need a global install of bunyan (npm install -g bunyan).

Developer documentation

The developer documentation is generated from the source code using docco and can be viewed online here. If you'd like to have an offline copy, just run npm run-script doc.

Running the tests

It's easy, just run npm test. The tests are written in BDD style, so they are a good starting point to understand the code.

Test coverage

To generate a code coverage report, run npm test --coverage (which runs very slowly, be patient). Code coverage summary as of version 3.0.1:

Statements   : 92.09% ( 1759/1910 )
Branches     : 82.56% ( 696/843 )
Functions    : 91.38% ( 212/232 )
Lines        : 92.17% ( 1753/1902 )

There's a hosted version of the detailed (line-by-line) coverage report here.

Logging

Logging is turned off by default. You can turn it on by passing a bunyan logger as log option when creating a server or agent.

When using the example server or client, it's very easy to turn logging on: set the HTTP2_LOG environment variable to fatal, error, warn, info, debug or trace (the logging level). To log every single incoming and outgoing data chunk, use HTTP2_LOG_DATA=1 besides HTTP2_LOG=trace. Log output goes to the standard error output. If the standard error is redirected into a file, then the log output is in bunyan's JSON format for easier post-mortem analysis.

Running the example server and client with info level logging output:

$ HTTP2_LOG=info node ./example/server.js
$ HTTP2_LOG=info node ./example/client.js 'http://localhost:8080/server.js' >/dev/null

Contributors

The co-maintainer of the project is Nick Hurley.

Code contributions are always welcome! People who contributed to node-http2 so far:

Special thanks to Google for financing the development of this module as part of their Summer of Code program (project: HTTP/2 prototype server implementation), and Nick Hurley of Mozilla, my GSoC mentor, who helped with regular code review and technical advices.

License

The MIT License

Copyright (C) 2013 Gábor Molnár gabor@molnar.es

About

An HTTP/2 client and server implementation for node.js

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 31

332是什么意思 悠悠是什么意思 喝酒前喝什么不容易醉 为什么经常放屁 钓鱼有什么好处
总蛋白是什么 一段奶粉和二段奶粉有什么区别 国家为什么要扫黄 生津止渴是什么意思 毛主席为什么不进故宫
急性心力衰竭的急救措施是什么 桃李满天下什么意思 午马是什么意思 6月25是什么星座 正常白带什么样
瓠子是什么 职务是什么意思 为什么会长脂肪粒 嫡传弟子是什么意思 什么水解渴
什么是eb病毒hcv8jop7ns1r.cn 麦芽糖醇是什么hcv9jop6ns8r.cn 男生爱出汗是什么原因hcv8jop0ns1r.cn 长期吃泡面有什么危害1949doufunao.com 金生水是什么意思hcv7jop7ns4r.cn
百香果是什么季节的hcv8jop3ns9r.cn 喝什么茶养肝护肝排毒hcv7jop5ns0r.cn 上海的特产是什么hcv9jop0ns5r.cn 喉咙嘶哑吃什么药hcv8jop0ns9r.cn josiny是什么牌子hcv9jop6ns1r.cn
滑石粉有什么作用hcv8jop5ns5r.cn 动销是什么意思hcv9jop8ns2r.cn 九月份什么星座dayuxmw.com 为什么开空调没蚊子hcv8jop8ns6r.cn 两个gg是什么牌子的包包hcv8jop2ns6r.cn
毛豆不能和什么一起吃creativexi.com 喉咙痛吃什么药好hcv9jop4ns4r.cn 大姨妈期间不能吃什么东西hcv8jop2ns5r.cn 什么体质的人才有季经hcv9jop7ns1r.cn 煲排骨汤放什么材料好xscnpatent.com
百度