
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@clusic/cluster
Advanced tools
集群启动模块
npm i @clusic/cluster
const path = require('path');
const master = require('@clusic/cluster');
const app = new master({
cwd: __dirname,
env: 'dev',
agents: ['agent', 'test', 'abc'],
framework: path.resolve(__dirname, 'framework'),
// max: 2
});
app.createServer().catch(e => app.kill());
Arguments:
/**
* IPC Master process
*
* OPTIONS:
* @param socket {boolean} <default: false> 是否开启socket模式
* @param port {number} <default: 8080> 服务启动端口
* @param cwd {string} <default: process.cwd()> 服务运行基址
* @param env {string} <default: 'development'> 环境变量
* @param debug {boolean|string} <default: false> 是否开启调试以及调试模式 eg: 'inspect-brk'
* @param framework {string} <default: __dirname> 服务启动框架
* @param max {Number} <default: os.cpus().length> 最大worker进程个数
* @type {module.MasterProcess}
*/
框架原型
module.exports = class Application {
constructor(app, data) {
this.data = data;
this.app = app;
}
// 进程创建周期
async processCreate() {
await new Promise((resolve, reject) => {
setTimeout(() => {
console.log('worker processWillCreate', Date.now());
// if (process.pid % 2 === 0) {
// return reject(new Error('test error'))
// }
resolve();
}, 2000);
});
}
// 消息接收函数
processMessage(msg, socket) {
if (msg.action === 'cluster:ready') {
console.log('all ready in worker ' + process.pid);
}
// console.log('message', msg);
}
//进程销毁周期
async processDestroy() {
await new Promise((resolve, reject) => {
setTimeout(() => {
console.log('worker processDestroy', Date.now());
resolve();
}, 2000);
});
}
};
FAQs
The cluster model of clusic
We found that @clusic/cluster 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.