
Product
Rust Support in Socket Is Now Generally Available
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.
hms-protocol
Advanced tools
The protocol stream that hms uses to communicate between servers and clients
The protocol stream that hms uses to communicate between servers and clients
npm install hms-protocol
This is mostly only useful for hms
Simply pipe the stream to and from a source
var protocol = require('hms-protocol');
var net = require('net');
net.createServer(function(stream) {
var p = protocol();
stream.pipe(p).pipe(stream);
p.on('start', function(id, cb) {
console.log('we received a start for', id);
cb();
});
}).listen(10000, function() {
var p = protocol();
var stream = net.connect(10000);
stream.pipe(p).pipe(stream);
p.start('test', function(err) {
console.log('start was received?', err);
});
});
The following messages are supported over the protocol
p.handshake(opts, cb) send a protocol handhakep.ping(cb) ping to see if remote is alivep.get(id, cb) get information about a servicep.add(id, service, cb) add a new service.p.update(id, service, cb) update an existing servicep.remove(id, cb) remove a servicep.list(cb) list all servicesp.ps(cb) get process information about all servicesp.start(id, cb) start a servicep.stop(id, cb) stop a servicep.restart(id, cb) restart a servicep.sync(id, service, cb) sync service statep.subscribe([id], cb) subscribe to service events. omit the id to subscribe to *p.unsubscribe([id], cb) unsubscribe from service events. omit the id to unsubscribe *p.stdout(id, origin, buffer) send a stdout eventp.stderr(id, origin, buffer) send a stderr eventp.spawn(id, origin, pid) send a process spawn eventp.exit(id, origin, code) send a process exit eventp.amSubscribing(id) returns true if you are subscribing to idp.peerSubscribing(id) returns true if the peer is subscribing to idThe service message can contain the following
{
start: 'node .',
build: 'npm install',
docks: [
'dock-id-to-run-at'
],
env: {
FOO: 'bar'
}
}
Sending any of the above messages will trigger an event of the same for the receiver.
I.e. if you do p.start(id, cb) it will result in p.on('start', id, cb) being triggered
for the receiver
MIT
FAQs
The protocol stream that hms uses to communicate between servers and clients
The npm package hms-protocol receives a total of 3 weekly downloads. As such, hms-protocol popularity was classified as not popular.
We found that hms-protocol 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.

Product
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.

Security News
Chrome 144 introduces the Temporal API, a modern approach to date and time handling designed to fix long-standing issues with JavaScript’s Date object.

Research
Five coordinated Chrome extensions enable session hijacking and block security controls across enterprise HR and ERP platforms.