Skip to content
This repository was archived by the owner on Feb 26, 2021. It is now read-only.

libp2p/js-libp2p-spdy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

js-libp2p-spdy

Build Status Dependency Status js-standard-style

SPDY 3.1 implementation wrapper that is compatible with libp2p Stream Muxer expected interface

Usage

Install

> npm i libp2p-spdy

In tour code

const spdy = require('libp2p-spdy')

API

Attaching it to a socket (duplex stream)

As a listener

const listener = spdy(socket, true)

As a dialer

const dialer = spdy(socket, false)

Opening a multiplex duplex stream

const conn = dialer.newStream((err, conn) => {})

conn.on('error', (err) => {})

note: Works the same on the listener side

Receiving incoming stream

dialer.on('stream', (conn) => {})

note: Works the same on the listener side

Close

dialer.close()

note: Works the same on the listener side

Other events

dialer.on('close', () => {})
dialer.on('error', () => {})

note: Works the same on the listener side

About

SPDY 3.1 implementation wrapper that is compatible with libp2p Stream Muxer expected interface

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 11