
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
webrtc-client
Advanced tools
A light wrapper around the WebRTC API. For an example server implementation see webrtc-handler.
var webrtc = require('webrtc-client')
getUserMedia({ audio: true, video: true }, function (stream) {
var video = document.querySelector('video')
var url = 'ws://localhost:8000'
var client = webrtc({ url: url, stream: stream })
client.on('stream add', function (remote, id) {
video.src = window.URL.createObjectURL(remote);
})
client.on('stream remove', function (remote, id) {
video.src = null
})
client.connect()
})
var webrtc = require('webrtc-client')
Returns a webrtc-client instance.
Websocket url of the signalling server.
Local stream to be sent to connected peers.
Log messages to the console.
Create a connection to the signalling server using the url given when the client was created.
The client will connect to peers advertised by the server through the peers
event.
The supplied obj
will be sent to the signalling server with a join
message.
This could contain application specific information for the server such as the room to join.
Close connection to the signalling server and any connected peers.
Fires when a new stream is received. cb
takes two arguments:
stream
- The remote stream received.id
- The id of the associated peer.Fires when a stream is removed. cb
takes two arguments:
stream
- The remote stream removed.id
- The id of the associated peer.FAQs
A light wrapper around the WebRTC API.
The npm package webrtc-client receives a total of 5 weekly downloads. As such, webrtc-client popularity was classified as not popular.
We found that webrtc-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.