Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
msgpack-rpc-lite
Advanced tools
Implementation of MessagePack-RPC with msgpack-lite
createServer([serverOptions][, codecOptions])
Creates a new MessagePack-RPC server.
serverOptions
<Object> See net.createServer([options][, connectionListener])codecOptions
<Object>
encode
See Custom Codec Optionsdecode
See Custom Codec OptionsServer event: method
Emitted when a new connection is made.
null
as the first argument and response parameters as the second argument.createClient(port[, host][, timeout][, codecOptions])
Initiates a MessagePack-RPC client.
port
<number> Port the socket should connect to.host
<string> Host the socket should connect to. Default: 'localhost'
timeout
<number> Sets the socket to timeout after timeout milliseconds of inactivity on the socket. If timeout is 0, then the existing idle timeout is disabled. Default: 0
codecOptions
<Object>
encode
See Custom Codec Optionsdecode
See Custom Codec Optionsclient.request(method[, ...args])
method
<string>client.notify(method[, ...args])
method
<string>Server
const rpc = require('msgpack-rpc-lite');
const server = rpc.createServer().on('say', (params, callback) => {
const [ message ] = params;
callback(null, `hello ${ message }`);
});
server.listen(9199);
Client
const rpc = require('msgpack-rpc-lite');
const client = rpc.createClient(9199, 'localhost');
client.request('say', [ 'world' ]).then(([ response ]) => {
console.log(response); // hello world
})
Set true
to useraw
of encode
/decode
of Codec-options.
const codecOptions = { encode: { useraw: true }, decode: { useraw: true } };
const client = rpc.createClient(9199, 'localhost', 0, codecOptions);
See also:
FAQs
Implementation of MessagePack-RPC with msgpack-lite
The npm package msgpack-rpc-lite receives a total of 4 weekly downloads. As such, msgpack-rpc-lite popularity was classified as not popular.
We found that msgpack-rpc-lite 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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.