Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@codingame/monaco-jsonrpc
Advanced tools
:warning: @CodinGame/monaco-jsonrpc is deprecated.
Use vscode-ws-jsonrpc instead
NPM module to implement communication between a jsonrpc client and server over WebSocket.
import * as rpc from 'monaco-jsonrpc';
const webSocket = new WebSocket('ws://www.example.com/socketserver');
rpc.listen({
webSocket,
onConnection: (connection: rpc.MessageConnection) => {
const notification = new rpc.NotificationType<string, void>('testNotification');
connection.listen();
connection.sendNotification(notification, 'Hello World');
}
});
import * as rpc from 'monaco-jsonrpc';
const socket: rpc.IWebSocket; // open the web socket
const reader = new rpc.WebSocketMessageReader(socket);
const writer = new rpc.WebSocketMessageWriter(socket);
const logger = new rpc.ConsoleLogger();
const connection = rpc.createMessageConnection(reader, writer, logger);
const notification = new rpc.NotificationType<string, void>('testNotification');
connection.onNotification(notification, (param: string) => {
console.log(param); // This prints Hello World
});
connection.listen();
import * as rpc from 'monaco-jsonrpc';
import * as server from 'monaco-jsonrpc/lib/server';
const socket: rpc.IWebSocket; // open the web socket
const reader = new rpc.WebSocketMessageReader(socket);
const writer = new rpc.WebSocketMessageWriter(socket);
const socketConnection = server.createConnection(reader, writer, () => socket.dispose())
const serverConnection = server.createServerProcess('Example', 'node', ['example.js']);
server.forward(socketConnection, serverConnection, message => {
if (rpc.isNotificationMessage(message)) {
if (message.method === 'testNotification') {
// handle the test notification
}
}
return message;
});
FAQs
VSCode JSON RPC over WebSocket
The npm package @codingame/monaco-jsonrpc receives a total of 2,232 weekly downloads. As such, @codingame/monaco-jsonrpc popularity was classified as popular.
We found that @codingame/monaco-jsonrpc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 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
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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.