
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.
This is an HTTP RMI implementation based on [Fastify](https://github.com/fastify/fastify).
This is an HTTP RMI implementation based on Fastify.
yarn add trmi-http
npm i trmi-http
You can find a more detailed example here.
Define and implement a remote service
type HelloResponse = {
message: string;
}
interface HelloWorldSpecification {
hello(world: string): Promise<HelloResponse>;
bye(): Promise<void>;
}
import { RemoteService, RemoteMethod } from 'trmi-http';
@RemoteService()
class HelloWorld implements HelloWorldSpecification {
@RemoteMethod()
async hello(world: string): Promise<HelloResponse> {
return {
message: `Hello ${world}!`,
};
}
@RemoteMethod()
async bye(): Promise<void> {
throw new Error('"bye" method is not implemented');
}
}
Start a remote service server
import { HttpRemoteServer } from 'trmi-http';
HttpRemoteServer.create({ port: 3478 })
.from(HelloWorld) // it is possible to pass varargs here
.start()
.catch(e => console.error('Failed to start a server', e));
Start a remote client
import { HttpRemoteServer } from 'trmi-http';
const client = HttpRemoteClient.create({ url: 'http://127.0.0.1:3478' }).start();
const helloWorld = client.getService<HelloWorldSpecification>('HelloWorld');
const response = await helloWorld.hello('world');
console.log(response.message);
helloWorld.bye().catch(console.log);
Remote service name
By default, the remote service name defaults to the class name. You can override this behaviour by passing a name property. Characters .~ are restricted as they are used in internal key generation.
@RemoteService({ name: 'MyServer_HelloWorld' })
class HelloWorld implements HelloWorldSpecification
client.getService<HelloWorldSpecification>('MyServer_HelloWorld');
Authorization
By default, server accepts requests from everywhere. You can change that by passing a AuthorizationProvider instance.
HttpRemoteServer.create({ authorization: TokenAuthorizationProvider.create('secret'), ... });
HttpRemoteClient.create({ authorization: TokenAuthorizationProvider.create('secret'), ... });
Server uses Fastify to receive requests from clients.
Client uses got to send requests.
FAQs
This is an HTTP RMI implementation based on [Fastify](https://github.com/fastify/fastify).
We found that trmi-http 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.