Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Jrus is a server-client communication utility package, which facilitates **seamless** remote procedure call.
Jrus is a server-client communication utility package, which facilitates seamless remote procedure call.
The communication protocol Jrus uses is jsonrpc 2.0.
npm i jrus
import { JrusServer, JrusError } from 'jrus';
// create a new server instance
const server = new JrusServer();
// register a service
server.register(class Utility {
async time() {
return new Date();
}
async sayHi({ name }) {
return { say: `hello, ${name} ` };
}
async wrong() {
throw new JrusError({ code: 10056, message: 'sample error' });
}
});
// run and listen on port 3000
server.listen(3000);
import { JrusClient } from 'jrus';
// create a client and connect http://localhost:3000
const client = new JrusClient('http://localhost:3000');
(async () => {
// remote procedure call: Utility.time
console.log(await client.services.Utility.time());
// 018-03-31T15:54:37.568Z
// remote procedure call: Utility.sayHi, with parameters { name: 'Special Name' }
console.log(await client.services.Utility.sayHi({ name: 'Special Name' }));
// { say: 'hello, Special Name ' }
// remote procedure call: Utility.wrong; and cathc error thrown on the server side
try {
await client.services.Utility.wrong();
} catch (e) {
console.error('Error caught: ', e);
// Error caught: JrusError { code: 10056, message: 'sample error' }
}
// call some function nonexist: Utility.right
try {
await client.services.Utility.right();
} catch (e) {
console.error('Error caught: ', e);
// Error caught: JrusError { code: -32601, message: 'Method not found' }
}
})();
FAQs
Jrus is a server-client communication utility package, which facilitates **seamless** remote procedure call.
The npm package jrus receives a total of 4 weekly downloads. As such, jrus popularity was classified as not popular.
We found that jrus 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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.