Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
webrtc-conductor
Advanced tools
A lightweight module to allow for efficient management, creation, reuse and destruction of WebRTC DataChannels.
A lightweight ES6 module to allow for efficient and simple management, creation, reuse and destruction of WebRTC DataChannels - independent of the signalling channel used for negotiation.
Presently, the module is extremely unstable and is functional up to the point where I can use it with a small amount of difficulty in my projects. Over time, I will fix and extend this module as needed.
One of the main goals of this library is to decouple the signalling channel used to initialise WebRTC connections from the management library itself - a move that I'm surprised no other library appears to have taken a transport-agnostic approach like this.
To connect to another peer:
//Assuming the existence of a channel implementation, FooChannel(webSocketAddr){...}
var Conductor = require("webrtc-conductor");
var myConductor = Conductor.create({
channel: new FooChannel("ws://somesite.com:9999")
});
myConductor.onconnection = /* Function handling connections made to this system. */;
myConductor.connectTo(/* String containing your partner's id. */)
.then(
result => {
//Code handling the connection.
}, reason => {
//Code handling a failed connection attempt.
}
);
Although these are properly detailed in src/example_channels/structure_example.js, a rough description is as follows:
function FooChannel(param){
// A reference to the bound manager.
// You may call:
// _manager.response(msg, channel): alert the manager that a response
// has been received, and delegate
// parsing it to the given channel.
//
// _manager.renameConnection(name1, name2): inform the manager that it must
// change a channel's name - typically
// used for bootstrapping into a
// P2P network.
this._manager = null;
// Internal ID used by the registry of the manager to help find
// registered channels by name.
this.internalID = "structure_example";
// Function called by manager when opening a new WebRTC Data Channel. This function
// is used to convert webrtc negotiation details into a form suitable for the
// channel, as well as sending this information along the channel.
this.send = function(id, type, data){
/*...*/
};
// Function called by the manager if the _manager.response(msg, channel)
// method is called. This function is used to parse and handle the data
// actually received, and interpret what class of message has been received.
this.onmessage = function(msg){
/*...*/
};
// An optional function called by the manager once the channel has been bound to it.
this.onbind = function(){
/*...*/
};
// Function called by the manager or application code if the channel must be closed.
// All cleanup and related logic should be handled here so that open connections
// are not left inaccessible by the program.
this.close = function(){
/* ... */
};
}
If you are implementing your own channel, I strongly recommend referring to the specification document to be aware of expected return types, further conventions and so on.
Note: Breaking changes will regularly occur before v1.0.0 due to instability of the library. Use at your own risk!
FAQs
A lightweight module to allow for efficient management, creation, reuse and destruction of WebRTC DataChannels.
The npm package webrtc-conductor receives a total of 3,270 weekly downloads. As such, webrtc-conductor popularity was classified as popular.
We found that webrtc-conductor 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.