Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including spdy-stream-muxer with all npm packages installed. Try it out:

var spdyStreamMuxer = require("spdy-stream-muxer")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

spdy-stream-muxer v0.6.1

Abstraction on top of spdy-transport, implementing the abstract-stream-muxer interface

spdy-stream-muxer JavaScript implementation

Abstraction on top of spdy-transport, implementing the abstract-stream-muxer interface

Usage

spdy-stream-muxer follows the abstract-stream-muxer API

Example

// Client.js
var spdyStreamMuxer = require('spdy-stream-muxer')

var dialer = new spdyStreamMuxer()

var connDialer = dialer.attach(socket, false)

connDialer.dialStream(function (err, stream) {
  t.ifError(err, 'Should not throw')
  t.pass('dialed stream')
})
// Server.js
var spdyStreamMuxer = require('spdy-stream-muxer')

var listener = new spdyStreamMuxer()

var connListener = listener.attach(socket, true)

connListener.on('stream', function (stream) {
  t.pass('got stream')
})
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free