
Security News
US Government Forces Anthropic to Pull Claude Fable Days After Launch
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.
A simple, fast RPC for Node.JS
npm install ac-noderpc
Create RPC server:
var noderpc = require('ac-noderpc')
var rpc_server = new noderpc.ServerRPC();
Methods:
publish([name,] function) - Publish a function to be exposed over RPC.
run(opt) - Run RPC server.
opt {
type : 'tcp',
host : '0.0.0.0',
port : 12345,
auth : 'your password'
}
Full example:
var noderpc = require('ac-noderpc')
var rpc_server = new noderpc.ServerRPC();
function sum() {
var ret = arguments[0]; /* first argument is return callback. */
var s = 0;
for ( var i = 1; i < arguments.length; i++) {
s += arguments[i];
}
ret(s);
};
rpc_server.publish(sum);
function test(ret) {
console.log('Just test, no return.');
ret(null); /* return callback is required otherwise client will receive a timeout error. */
};
rpc_server.publish(test);
rpc_server.publish('add', function(ret, a, b) {
ret(a + b);
});
rpc_server.publish('getobj', function(ret) {
ret({
a : 'abc',
d : 'cde',
c : [1, 2, 3]
}, 4, 5, 6);
});
rpc_server.run({
type : 'tcp',
port : 12345,
auth : 'abcdef'
});
Create RPC client
var noderpc = require('ac-noderpc')
var rpc_client = new noderpc.ClientRPC();
Events:
Properties:
Methods:
tryConnect(opt) - Try to connect to the RPC server, it will automatically reconnect to the RPC server when the RPC server is unavailable.
opt {
type : 'tcp',
host : '0.0.0.0',
port : 12345,
auth : 'your password'
}
Full example:
var noderpc = require('ac-noderpc')
var rpc_client = new noderpc.ClientRPC();
rpc_client.event.on('error', function(err) {
console.log(err);
});
rpc_client.event.on('connected', function() {
console.log('connected');
});
rpc_client.event.on('disconnected', function() {
console.log('disconnected');
});
rpc_client.event.on('ready', function() {
rpc_client.sum(function(err, result) {
if ( err ) {
console.log(err);
} else {
console.log(result);
}
}, 1, 2, 3, 4);
rpc_client.test(function(err, result) {
console.log('test: ' + err);
console.log('test: ' + result);
});
rpc_client.add(function(err, result) {
if ( err ) {
console.log(err);
} else {
console.log(result);
}
}, 5, 7);
rpc_client.getobj(function(err, obj, a, b, c) {
console.log('getobj: ' + err);
console.log('getobj: ' + JSON.stringify(obj));
console.log('getobj: ' + a + ', ' + b + ', ' + c);
});
});
rpc_client.tryConnect({
type : 'tcp',
host : '127.0.0.1',
port : 12345,
auth : 'abcdef'
});
Create RPC Proxy
var noderpc = require('ac-noderpc')
var rpc_proxy = new noderpc.ProxyRPC();
Events:
Properties:
Methods:
addHost(opt) - Add RPC host to the proxy.
opt {
type : 'tcp',
host : '0.0.0.0',
port : 12345,
auth : 'your password',
priority : 1
}
isValid() - Check the proxy is valid.
Full example:
var noderpc = require('ac-noderpc')
var rpc_proxy = new noderpc.ProxyRPC();
rpc_proxy.event.on('proxy_valid', function() {
console.log('Proxy Valid.');
rpc_proxy.sum(function(err, result) {
if ( err ) {
console.log(err);
} else {
console.log(result);
}
}, 1, 2, 3);
});
rpc_proxy.event.on('proxy_invalid', function() {
console.log('Proxy Invalid.');
});
rpc_proxy.event.on('error', function(err, client) {
console.log('Error: ' + err);
});
rpc_proxy.addHost({
type : 'tcp',
host : '127.0.0.1',
port : 12345,
auth : 'abcdef',
priority : 1
});
rpc_proxy.addHost({
type : 'tcp',
host : '127.0.0.1',
port : 12345,
auth : 'abcdef',
priority : 1
});
FAQs
A simple, fast RPC for Node.JS
The npm package ac-noderpc receives a total of 18 weekly downloads. As such, ac-noderpc popularity was classified as not popular.
We found that ac-noderpc 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
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.

Security News
A network of 152 Chrome live wallpaper extensions hid ad tracking and made extension-driven traffic look like Google search clicks.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.