
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
A simple node-js-tcp publish-subscribe framework. With a broker and a client called member.
A simple node-js-tcp publish-subscribe framework. With a broker and a client called member.
The idea of this framework is, to let diffrent nodejs-apps communicate together. I know there are diffrent kinds of pub-sub-patterns. But i was interested to do this implementation by the net-library.
npm install tcppubsub --save
var tcppubsub = require('tcppubsub')
var port = 2223
var host = 'localhost'
var blockPublisher = false // block payload sending to publisher, if he has subscribed the topic too
var broker = new tcppubsub.Broker(port, host, blockPublisher)
broker.listen()
broker.getConnections(function(err, numb){
console.log('connected members:', numb)
})
//you can use some socket-events if needed
broker.on('end', function(msg){console.log(msg)})
broker.on('close', function(member){console.log(member)})
broker.on('error', function(err){console.log(err)})
broker.on('published', function(topic, data){console.log(topic, data)})
broker.on('subscribed', function(topic){console.log(topic)})
broker.on('unsubscribed', function(topic){console.log(topic)})
var tcppubsub = require('tcppubsub')
var port = 2223
var host = 'localhost'
//Create the member
var member = new tcppubsub.Member(port, host)
//Subscribe the topic without callback
member.sub('other/member/timer')
// Subscribe the topic STRING or ARRAY
member.sub('app/configuration/server', function(topic){
// Publish some data STRING, OBJECT, ARRAY
member.pub('app/configuration/server', {a : 1, b : 'Hello World'})
})
// Receive the data on the certain topic
member.on('app/configuration/server', function(data){
// Unsubscribe the topic
member.unsub('app/configuration/server')
console.log(data)
})
/******* OR *******/
// Receive all subscribed data
member.on('message', function(topic, data){
member.unsub('app/configuration/server')
console.log(topic, data)
})
var tcppubsub = require('tcppubsub')
var port = 2223
var host = 'localhost'
//Create the member
var other = new tcppubsub.Member(port, host)
//publish data on the topic 'other/member/timer'
setInterval(function(){
other.pub('other/member/timer', 'Moin moin at ' + Date())
},1000)
This project is licensed under the MIT License - see the LICENSE.md file for details
FAQs
A simple node-js-tcp publish-subscribe framework. With a broker and a client called member.
The npm package tcppubsub receives a total of 1 weekly downloads. As such, tcppubsub popularity was classified as not popular.
We found that tcppubsub 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.