http2lite

0.0.10 • Public • Published

npm version JavaScript Style Guide Build Status Coverage Status GPL Licence
Known Vulnerabilities Dependency Status devDependencies Status
Maintainability Inline docs

Http2Lite

zero dependency tools for DIY http2 in node or browser (with a build tool that understands require)

TODO

  • more documentation
  • fix "code smells"
  • put something meaningful into the readme
  • build a simple default hpack context
  • add an example (or two)
  • fix generated API documentation

API

Table of Contents

H2LSession

Extends Emitter

Muxes and demuxes

Parameters

  • nextStreamId Number default is 1 for client, passing 2 would be for server (optional, default 1)

writeFrame

Emit any new http messages. Emit new streams when necessary.

Parameters
  • frame Uint8Array partial and/or multiple encoded http messages

request

Returns H2LStream

H2LStream

Extends Emitter

Gateway for reading from and writing to virtual streams

Parameters

writeRequest

Encode http-like request and mux it into the output stream

Parameters
  • request

Request

Type: Object

Properties

decodeRequest

Parameters

Returns Request

encodeRequest

Parameters

Returns Uint8Array

decodeFrameHeader

Parameters

Returns FrameHeader

FrameHeader

Type: Object

Properties

encodeFrameHeader

Parameters

Returns Uint8Array

decodeFlags

Parameters

Returns Flags

Flags

Type: Object

Properties

decodePriority

Parameters

Returns Priority

Priority

Type: Object

Properties

encodePriority

Parameters

Returns Uint8Array

alloc

Parameters

Returns Uint8Array

allocUnsafe

Parameters

Returns Uint8Array

readUInt8

Parameters

Returns Number

readUInt24BE

Parameters

Returns Number

readUInt32BE

Parameters

Returns Number

writeUInt8

Parameters

writeUInt24BE

Parameters

writeUInt32BE

Parameters

concat

Parameters

Returns Uint8Array

Readme

Keywords

none

Package Sidebar

Install

npm i http2lite

Weekly Downloads

5

Version

0.0.10

License

GPL-3.0

Unpacked Size

101 kB

Total Files

29

Last publish

Collaborators

  • dtudury