source: trip-planner-front/node_modules/spdy-transport/README.md

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 2.6 KB
Line 
1# spdy-transport
2
3[![Build Status](https://travis-ci.org/spdy-http2/spdy-transport.svg?branch=master)](http://travis-ci.org/spdy-http2/spdy-transport)
4[![NPM version](https://badge.fury.io/js/spdy-transport.svg)](http://badge.fury.io/js/spdy-transport)
5[![dependencies Status](https://david-dm.org/spdy-http2/spdy-transport/status.svg?style=flat-square)](https://david-dm.org/spdy-http2/spdy-transport)
6[![Standard - JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat-square)](http://standardjs.com/)
7[![Waffle](https://img.shields.io/badge/track-waffle-blue.svg?style=flat-square)](https://waffle.io/spdy-http2/node-spdy)
8
9> SPDY/HTTP2 generic transport implementation.
10
11## Usage
12
13```javascript
14var transport = require('spdy-transport');
15
16// NOTE: socket is some stream or net.Socket instance, may be an argument
17// of `net.createServer`'s connection handler.
18
19var server = transport.connection.create(socket, {
20 protocol: 'http2',
21 isServer: true
22});
23
24server.on('stream', function(stream) {
25 console.log(stream.method, stream.path, stream.headers);
26 stream.respond(200, {
27 header: 'value'
28 });
29
30 stream.on('readable', function() {
31 var chunk = stream.read();
32 if (!chunk)
33 return;
34
35 console.log(chunk);
36 });
37
38 stream.on('end', function() {
39 console.log('end');
40 });
41
42 // And other node.js Stream APIs
43 // ...
44});
45```
46
47## LICENSE
48
49This software is licensed under the MIT License.
50
51Copyright Fedor Indutny, 2015.
52
53Permission is hereby granted, free of charge, to any person obtaining a
54copy of this software and associated documentation files (the
55"Software"), to deal in the Software without restriction, including
56without limitation the rights to use, copy, modify, merge, publish,
57distribute, sublicense, and/or sell copies of the Software, and to permit
58persons to whom the Software is furnished to do so, subject to the
59following conditions:
60
61The above copyright notice and this permission notice shall be included
62in all copies or substantial portions of the Software.
63
64THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
65OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
66MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
67NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
68DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
69OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
70USE OR OTHER DEALINGS IN THE SOFTWARE.
71
72[0]: http://json.org/
73[1]: http://github.com/indutny/bud-backend
74[2]: https://github.com/nodejs/io.js
75[3]: https://github.com/libuv/libuv
76[4]: http://openssl.org/
Note: See TracBrowser for help on using the repository browser.