Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
react-native-peerjs
Advanced tools
react-native-webrtc has brought WebRTC to React Native. PeerJS is a simple API to work with WebRTC in the Browser.
I made it so that PeerJS works with react-native-webrtc in a React Native application.
Install react-native-webrtc according to their install guide. Then add react-native-peerjs:
yarn add react-native-peerjs
Just refer to the PeerJS documentation. Here is an example:
import Peer from 'react-native-peerjs';
const localPeer = new Peer();
localPeer.on('error', console.log);
localPeer.on('open', localPeerId => {
console.log('Local peer open with ID', localPeerId);
const remotePeer = new Peer();
remotePeer.on('error', console.log);
remotePeer.on('open', remotePeerId => {
console.log('Remote peer open with ID', remotePeerId);
const conn = remotePeer.connect(localPeerId);
conn.on('error', console.log);
conn.on('open', () => {
console.log('Remote peer has opened connection.');
console.log('conn', conn);
conn.on('data', data => console.log('Received from local peer', data));
console.log('Remote peer sending data.');
conn.send('Hello, this is the REMOTE peer!');
});
});
});
localPeer.on('connection', conn => {
console.log('Local peer has received connection.');
conn.on('error', console.log);
conn.on('open', () => {
console.log('Local peer has opened connection.');
console.log('conn', conn);
conn.on('data', data => console.log('Received from remote peer', data));
console.log('Local peer sending data.');
conn.send('Hello, this is the LOCAL peer!');
});
});
FAQs
react-native-webrtc + peerjs
The npm package react-native-peerjs receives a total of 58 weekly downloads. As such, react-native-peerjs popularity was classified as not popular.
We found that react-native-peerjs 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.