WebRTC samples Generate and transfer data

This page generates and sends the specified amount of data via WebRTC datachannels.

To accomplish this in an interoperable way, the data is split into chunks which are then transferred via the datachannel. The datachannel is reliable and ordered by default which is well-suited to filetransfers.

Send and receive progress is monitored using HTML5 progress elements.

Send progress:
Receive progress:

View the console to see logging.

The RTCPeerConnection objects localConnection and remoteConnection are in global scope, so you can inspect them in the console as well.

For more information about RTCDataChannel, see Getting Started With WebRTC.

View source on GitHub