New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

skyway-m-pipe-sdk

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

skyway-m-pipe-sdk

SDK for m-pipe

  • 0.0.1
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

skyway-m-pipe-sdk

SDK of SkyWay Media Pipeline Factory (M-PIPE)

Install

$ npm insatll skyway-m-pipe-sdk

snipets

Connector

Connector SDK of M-PIPE components

  • Input Stream
const { InputStream } = require('skyway-m-pipe-sdk/connector');

const inputStream = new InputStream();

// you need to set hostname and port number of previous component
// please make sure that same token with previous as well
inputStream.start({ host: inHost, port: inPort, token });

inputStream.on( 'data', data => {
  // #=> data.type - arbitrary type data in string format
  //     data.meta - arbitrary meta data in string format
  //     data.payload - arbitrary payload data in binary format
})
  • Output Stream
const { OutputStream } = require('skyway-m-pipe-sdk/connector');

const outputStream = new OutputStream();

outputStream.start({ port: outPort, token })

outputStream.write({
   type: 'test-stream',
   meta: JSON.stringify({ name: test, ts: Date.now() }),
   payload: Buffer.from( 'Hello world' )
})

EventGateway

Interface SDK of event gateway of M-PIPE

  • subscribe
const EventGateway = require('m-pipe-sdk/event-gateway')

const ufUrl = `http://${hostname}:${port}`
const eventGateway = new EventGateway( { host: evHost } )

// register functions
await eventGateway.registUrl( 'statem.noticePeerid',    `${ufUrl}/peerid` )
await eventGateway.registUrl( 'statem.noticeConnected', `${ufUrl}/connected` )
await eventGateway.registUrl( 'statem.reqClosing',      `${ufUrl}/close`  )

// subscribe bindings
await eventGateway.subscribe( 'webrtc.session.ready',      'statem.noticePeerid'  )
await eventGateway.subscribe( 'webrtc.session.connected',  'statem.noticeConnected' )
await eventGateway.subscribe( 'webrtc.session.closing',    'statem.reqClosing'    )
  • emit
const EventGateway = require('m-pipe-sdk/event-gateway')
const eventGateway = new EventGateway( { host: evHost } )

eventGateway.emit('webrtc.session.closed', { token })

Copyright. NTT Communications Corporation All rights reserved.

FAQs

Package last updated on 19 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc