
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
connect.io
Advanced tools
Real-time bidirectional event-based communication in Chrome extensions or Apps inspired by Socket.IO.
npm i -S connect.io
background.html:
<script src="node_modules/connect.io/dist/connect.js"></script>
<script>
const server = new ChromeConnect.Server();
server.on('connect',(client)=> {
if (client.exteranl && client.port.sender.url === YourBlackList) {
client.disconnect();
return;
}
// Only send message to this connection client.
// If you want get response, pass "true" as the last argument,
// then "client.send()" will return a promise.
// Otherwise, "client.send()" just return undefined.
client
.send('welcome','hello world',true)
.then(
response => console.log(response), // print "Thanks!"
error => console.log(error) // print "I'm not happy."
);
// Note: if you just want send a "true" to the other side and don't want response,
// You must do:
client.send('send true and do not need response',true,false);
// I recommend you use 1 to instead of true:
client.send('use 1 to instead of true',1);
// and in Server:
//server.on('use 1 to instead of true',(data)=>{
// console.log(data); // 1
// if(data) {
// //...
// }
//});
// Sending a message to everyone else except for the connection that starts it.
client.broadcast('join','new client joined.');
// Sending response to client
client.on('report clients number', (data, sendResponse) => {
sendResponse(null ,server.ports.length);
});
// handle connection disconnect on Server
client.once('disconnect', isOtherSide => {
// Sending messge to every connection.
server.send(isOtherSide ? 'Someone out by himself.' : 'I knock it out.');
});
});
</script>
Client(content-scripts.html):
<script src="node_modules/connect.io/dist/connect.js"></script>
<script>
const client = new ChromeConnect.Client('optional extensions or apps id or tabId, default value is chrome.runtime.id');
client.on('welcome',(data,sendResponse) => {
console.log(data); // 'hello world'
// if you want, you can send a response to Server.
sendResponse( null, 'Thanks!' );
// or you can send an error as a rejection.
sendResponse('I\'m not happy.');
});
client.on('join',function(data){
console.log(data); // "new client joined."
});
// get Server response.
client
.send('report clients number',true)
.then(
res => console.log(res) , // 1
error => console.log(error)
);
client.on('Someone out',()=>{
// ...
});
// handle connection disconnect on Client
client.once('disconnect', isOtherSide => {
console.log('Connection disconnected by ', isOtherSide ? 'the other side' : 'myself', '.');
});
// disconnect the connection.
client.disconnect();
</script>
FAQs
Real-time bidirectional event-based and Promise friendly communication in Chrome extensions or Apps inspired by Socket.IO.
The npm package connect.io receives a total of 5 weekly downloads. As such, connect.io popularity was classified as not popular.
We found that connect.io 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 uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.