Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

WebRTC Data Channel Establishment Protocol

License

NotificationsYou must be signed in to change notification settings

nodertc/datachannel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build StatusnpmnodelicensedownloadsCoverage Statustelegram

WebRTC Data Channel Establishment Protocol. Supported RFC:

Usage

const{ createChannel}=require('@nodertc/datachannel');constinput=createSctpSourceStream({id:1});constoutput=createSctpTargetStream({id:1});constchannel=createChannel({ input, output,label:'nodertc'});channel.on('data',data=>{console.log('Channel %s says:',channel.label,data.toString())});

API

  • createChannel(options: Options): Channel

Creates the Data Channel.

  • Options.input: stream.Readable

Source stream.

  • Options.output: stream.Writable

Target stream.

  • Options.negotiated: boolean, default false

The default value of false tells the user agent to announce the channel in-band and instruct the other peer to dispatch a corresponding Channel object. If set to true, it is up to the application to negotiate the channel.

  • Options.label: string, default ""

A label that can be used to distinguish this Channel object from other one.

  • Options.protocol: string, default ""

Subprotocol name used for this channel.

  • Options.priority: number, default 0

Priority of this channel.

  • Options.ordered: boolean, default false

The type of the delivery. Defaultfalse.

  • Options.retries: number, optional

The number of retransmissions.

  • Options.lifetime: number, optional

The maximum lifetime in milliseconds.

  • class Channel

This class is an abstraction of the Data Channel. AChannel is also aduplex stream, so it can be both readable and writable, and it is also aEventEmitter.

  • Channel.label: string, readonly

The name of the Data Channel.

  • Channel.priority: number, readonly

The priority of the Data Channel.

  • Channel.protocol: string, readonly

The name of a protocol registered in the'WebSocket Subprotocol Name Registry'.

  • Channel.type: number, readonly

Get the channel type.

  • Channel.ordered: boolean, readonly

Get the type of the delivery.

  • Channel.negotiated: boolean, readonly

Returns true if the Data Channel was negotiated by the application, or false otherwise.

  • Channel.reliability: number, readonly

For reliable Data Channels this field MUST be set to 0 on the sending side and MUST be ignored on the receiving side. If a partial reliable Data Channel with limited number of retransmissions is used, this field specifies the number of retransmissions. If a partial reliable Data Channel with limited lifetime is used, this field specifies the maximum lifetime in milliseconds.

  • Channel.close()

Closes the channel. Theinput andoutput channels keeps untouched.

License

MIT, 2018 © Dmitriy Tsvettsikh

About

WebRTC Data Channel Establishment Protocol

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp