Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
aliyun ons plugin for egg
$ npm i egg-ons --save
// {app_root}/config/plugin.js
exports.ons = {
enable: true,
package: 'egg-ons',
};
// {app_root}/config/config.default.js
exports.ons = {
default: {
accessKey: 'your-accessKey',
secretKey: 'your-secretKey',
// prod:http://onsaddr-internal.aliyun.com:8080/rocketmq/nsaddr4client-internal
// dev: http://onsaddr-internet.aliyun.com/rocketmq/nsaddr4client-internet
// onsAddr: 'http://onsaddr-internet.aliyun.com/rocketmq/nsaddr4client-internet',
},
sub: [{
consumerGroup: 'your-consumer-group',
topics: [
'your-topic',
],
}],
pub: [{
producerGroup: 'your-producer-group',
topics: [
'your-topic',
],
}],
};
see config/config.default.js for more detail.
put your subscription codes under the folder {app_root}/app/ons
and named as the topic name e.g TP_NAME.js
.
├── app
│ ├── ons
│ │ └── TP_NAME.js
│ ├── public
│ └── router.js
├── config
│ └── config.default.js
├── package.json
you should implment a subscriber as blow
// TP_NAME.js
'use strict';
class TestSubscriber {
constructor(ctx) {
this.ctx = ctx;
}
* subscribe(msg) {
yield this.ctx.service.messageService.process(msg);
}
static get subExpression() {
return 'TagA';
}
}
module.exports = TestSubscriber;
see RPC for more detail.
using app.ons / ctx.ons
to create & send messages
const Message = ctx.ons.Message;
const msg = new Message('TP_NAME', // topic
'TagA', // tag
'Hello ONS !!!' // body
);
const sendResult = yield ctx.ons.send(msg);
Please open an issue here.
ping @fengmk2 to give you the access key!
FAQs
aliyun ons plugin for egg
The npm package egg-ons receives a total of 4 weekly downloads. As such, egg-ons popularity was classified as not popular.
We found that egg-ons demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.